The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Column Sum
#3
If you're still having a problem with this and getting your query right, you can do something like this.

Code:
$count = 0;
Code:
$query = $db->query("SELECT sendout FROM sendouts")->results();
Code:
foreach ($q as $sum){
Code:
$count = $count + $sum->sendout;
Code:
}
Code:
echo $count;

It's important to establish
Code:
$count = 0
outside of your foreach loop first.
  Reply


Messages In This Thread
Column Sum - by matt - 11-01-2017, 11:03 AM
Column Sum - by Brandin - 11-01-2017, 11:54 AM
Column Sum - by mudmin - 11-01-2017, 02:35 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)