Re: trouble with a query object
| From: | Richard Lynch | Date: | Wed, 31 Jan 2001 01:36:11 +0000 |
| Subject: | Re: trouble with a query object | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-37385@lists.php.net to get a copy of this message | ||
> $nameArray = array("Last", "Suffix", "Prefix", "First",
> "Middle");
> while (list($key, $value) = each ($nameArray)){
> if ($infoObject->$value != ""){
> echo "$infoObject->$value"; #this is the problem line...
> }
> }
> ************
>
> If I take out the "$infoObject->" on the problem line, the correct value
is
> displayed. But while "$infoObject->" is present, the error is given. I
> assumed that $value would be a string since the array is of strings. If I
> used mysql_fetch_array and used $value for the index of the array, would
the
> same thing happen? Thanks for the help.
Try getting rid of the quotes in your problem line, and then switch to
mysql_fetch_array if that doesn't help.
--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm