Re: array_sum help

From: Date: Thu, 13 Mar 2003 11:04:50 +0000
Subject: Re: array_sum help
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-139481@lists.php.net to get a copy of this message
There should not be any problem with zeros, as long as they are in array. The warning tells you, you are not passing an array, so there must be some broken logic in your code. Try putting print_r($the_array) before line 154 Beauford.2002 wrote:
Hi, I have a mysql database in which some values are loaded into an array - the problem is that some fields may contain zeros. The problem is the following. If there happens to be zeros in certain column's (which there will be from time to time) then I get this error. How do I get around this? Funny thing about this is I have the exact same thing duplicated on my Windows PC and it doesn't cause this problem. (the problem one is on Linux which is the production one). All versions of mysql, PHP, apache are the same on both. Note that as soon as I put in a number it works fine..... Warning: The argument to array_sum() should be an array in /usr/local/apache/htdocs/main/viewstats.php on line 154 TIA


« previous php.general (#139481) next »