Re: Warning messages on web page.
| From: | Shreyas Agasthya | Date: | Tue, 22 Jun 2010 14:39:42 +0000 |
| Subject: | Re: Warning messages on web page. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-306305@lists.php.net to get a copy of this message | ||
Mike,
A couple of things that I could understand reading carefully at the error.
1. reset takes an array as the input and perhaps your $thumbsarray is *not *an
array? Reset will set the internal pointer to the start of the array.
2. Warning # 2 is very closely related to #1 since you can iterate on an
array and not on a variable.
3. Just FYI - You can control the behavior should or not these
warnings/notices/errors in your php.ini file. Do a quick google and you
should be happy to see the result.
Regards,
Shreyas
On Tue, Jun 22, 2010 at 7:47 PM, Mike Davies <mike@integrawebdesign.co.uk>wrote:
> Hello,
>
> This is my first post to this list and I am a novice at php coding. I
> can generally follow the code but not good at writing from scratch.
>
>
> I have recently been trying to add to a website which was originally
> developed by someone else and is written in php and mysql. I am trying
> to add a 'news' section to the site. This would be similar to an
> existing 'projects' section so, rather than write it completely from
> scratch I copied the php and the database tables from the 'project'
> section and renamed 'project' to 'news'.
>
>
> This is working well except for one thing – I get the following error
> messages when looking at the detailed news item. This code does not
> produce this warning in the project section which is using the same php
> code
>
>
> Warning: reset() [function.reset]: Passed variable is not an array or
> object in /home/b23aadf/public_html/news/details.php on line 72
>
> Warning: Variable passed to each() is not an array or object
> in /home/b23aadf/public_html/news/details.php on line 73
>
>
> The relevant lines are :
>
>
> 72 reset($thumbsarray);
>
> 73 while (list($key, $value) = each($thumbsarray)) {
>
> The site is at www.aadf.co.uk and select 'News'.
>
> Is anyone able to help resolve this? If you let me know what further
> information you require I can provide it.
>
>
> Mike Davies
>
> --
> Mike Davies
> Integra Web Design, Rhynie, By Huntly, AB54 4LS
> 01464 861535 www.integrawebdesign.co.uk
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Regards,
Shreyas Agasthya