Log in

View Full Version : This makes no sense to me


amykhar
10-04-2004, 11:26 AM
How could some people be seeing a warning (Warning: Invalid argument supplied for foreach() in /home/eaforums/public_html/forums/misc.php on line 229
)
on this page:
http://www.eaforums.com/forums/misc.php?do=getfavsmilie

and not other users?



I have tested on two operating systems, numerous browsers and two separate computers but am not seeing the warning. Shouldn't a php warning apply to everyone?

The line of code in question is:

foreach ($nabn AS $favsmilie)

I know this error DID happen when I originally uploaded the file yesterday because I had
$nabn and $favsmilie reversed. But, I fixed it and everything is running fine for me. The one user swears she cleared her cache. I could understand problems if they were reaching a different line of code, or javascript errors or display errors. But how are they selectively getting warnings on what seems to be a valid line of code?



Amy

Dean C
10-04-2004, 11:31 AM
I'm guessing this is a modification where uses can have an organized collection of their favorite smilies? Are you storing the ids of these smilies in a list in your database and then exploding them? If users have no favorite smilies then it won't be an array. Just a thought based on what you have to show :)

amykhar
10-04-2004, 01:43 PM
I'm guessing this is a modification where uses can have an organized collection of their favorite smilies? Are you storing the ids of these smilies in a list in your database and then exploding them? If users have no favorite smilies then it won't be an array. Just a thought based on what you have to show :)
Doh! I had an if clause around it when I was first working but must have deleted it. Good catch Dean!

Amy

Dean C
10-04-2004, 01:54 PM
You're welcome :)