FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » General » PHP discussions » invalid argument
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
invalid argument [message #21864] Tue, 21 December 2004 16:37 Go to next message
curtbuchanan is currently offline  curtbuchanan   United States
Messages: 1
Registered: December 2004
Karma: 0
Junior Member
hi...im a nebie at this forum.

i came across an invalid argument warning pointing to a foreach loop. it seems that when i was working with this file last week everything went good, but now its giving me this error.

$this->nameSearch->restore();
foreach($this->nameSearch->results[$lastName][$firstName]['hits'] as $row)
{
if($row['instNum']==$instNum && $row['year']==$year)
{
$path=$row['imgPath'];
}


im running php version 4.2.3 on win xp. What am i missing/going wrong?

[Updated on: Tue, 21 December 2004 16:37]

Report message to a moderator

Re: invalid argument [message #31410 is a reply to message #21864] Fri, 21 April 2006 09:19 Go to previous message
richardlynch is currently offline  richardlynch   United States
Messages: 8
Registered: April 2006
Karma: 0
Junior Member
The "invalid argument" to a foreach can pretty much only mean one thing:

The variable you are thinking is an array isn't an array.

Use print_r on it and see what it is.

You'll also probably need to print_r all the things in front of -> before you are done, in order to figure out where in that rather long chain of -> you went wrong.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Undefined Index Troubles... [Help Please]
Next Topic: running both versions - php 4.3.0 and php 5 on one Apache-Server on Windows
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 13:04:17 GMT 2024

Total time taken to generate the page: 0.03644 seconds