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

Home » General » PHP discussions » invalid argument
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
invalid argument [message #21864] Tue, 21 December 2004 11:37 Go to next message
curtbuchanan is currently offline  curtbuchanan   United States
Messages: 1
Registered: December 2004
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
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 11:37]

Report message to a moderator

Re: invalid argument [message #31410 is a reply to message #21864] Fri, 21 April 2006 05:19 Go to previous message
richardlynch is currently offline  richardlynch   United States
Messages: 8
Registered: April 2006
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
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.
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
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: Fri Dec 15 09:14:06 EST 2017

Total time taken to generate the page: 0.00626 seconds