PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   Troubleshooting (http://www.phpdig.net/forum/forumdisplay.php?f=22)
-   -   Warning: .... foreach() (http://www.phpdig.net/forum/showthread.php?t=320)

isto 12-22-2003 08:11 AM

Warning: .... foreach()
 
I get this error when I visit the link "response time by hour" in the admin menue.

Warning: Invalid argument supplied for foreach() in /var/www/web25/html/navigation/phpdig/admin/robot_functions.php on line 1364


anybody an idea what to do?

Charter 12-23-2003 05:20 AM

Hi. What OS and version of PhpDig are you running?

isto 12-23-2003 11:02 AM

PhpDig Version 1.6.5
PHP Version 4.3.2
MySql Version 3.23.49
Apache 1.3.26 (Unix)
Server Protocol HTTP/1.1
System Linux
Server API Apache

Charter 12-23-2003 04:03 PM

Hi. It looks like the following query is returning zero results. When that happens $result is not an array so foreach() throws a warning. As soon as the query returns greater than zero results, the warning should go away. Thanks for pointing it out. It's something to tweak in a future release.
PHP Code:

$query 'SELECT DATE_FORMAT(l_ts,\\'%H:00') as hour,
round(avg(l_time),2) as avg_time,
count(l_id) as num_queries
FROM '
.PHPDIG_DB_PREFIX.'logs
WHERE l_time > 0
GROUP BY hour'
;
$result phpdigMySelect($id_connect,$query); 



All times are GMT -8. The time now is 03:03 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.