On Wed, Jun 23, 2010 at 11:14, Mike Davies <m...@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.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to