Re: Warning messages on web page.

From: Date: Wed, 23 Jun 2010 15:24:48 +0000
Subject: Re: Warning messages on web page.
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-306376@lists.php.net to get a copy of this message
On Wed, Jun 23, 2010 at 11:14, Mike Davies <mike@integrawebdesign.co.uk> wrote: >> > Nothing is returned for SELECT query as there is nothing in the table as > yet. Perhaps this is the problem. Typically all projects would have an > associated thumb image but all news items may not. Perhaps a thumb image > is necessary to stop this warning? Should I change the code to allow for > there being no thumb image, if so can you suggest how I might modify it? With no rows returned, there's no array. The while() loop doesn't even trigger there. You could either add some dummy data, populate the rows, or adjust the code like so: <?php if (isset($thumbsarray) && is_array($thumbsarray)) { while (list($key, $value) = each($thumbsarray)) { // ... } } else { // There are no thumbs. Oh, my God, the horror! No thumbs! } ?> -- </Daniel P. Brown> UNADVERTISED DEDICATED SERVER SPECIALS SAME-DAY SETUP Just ask me what we're offering today! daniel.brown@parasane.net || danbrown@php.net http://www.parasane.net/ || http://www.pilotpig.net/

« previous php.general (#306376) next »