invalid argument [message #21864] |
Tue, 21 December 2004 16:37 |
curtbuchanan
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 |
richardlynch
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.
|
|
|