0

Warning: array_sum() [function.array-sum]: The argument should be an array in pdf.php on line 112

i am getting this error and i dont see what the problem is. it calls values and adds them

$result = mysql_query("SELECT * FROM sold_produce WHERE invoice_id='$invoice_id' ");
        while($myrow = mysql_fetch_assoc($result))
             { 
  $total2[] = $myrow['total'];
	}
	$content .= array_sum($total2);

Edited by itisnot_me: n/a

2
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by rajarajan07
0
$result = mysql_query("SELECT * FROM sold_produce WHERE invoice_id='$invoice_id' ");
$total2=array();
        while($myrow = mysql_fetch_assoc($result))
             { 
  array_push($total2, $myrow['total']);
	}
	$content = array_sum($total2);
0

nvm. it turns out that there was a sligh little devil hiding screwing it all up

0

sorry the code i had was fine. it was that a variable was hiding that over wrote what i had previous. i hate it when i ask for help and then i find what the problem was after

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.