php3-list | 2000051
Date: 05/04/00
- Next message: Richard Lynch: "Re: [PHP3] Can't get data from query"
- Previous message: Richard Lynch: "Re: [PHP3] converting from hexidecimal to decimal, and vice-versa."
- In reply to: darcy w. christ: "[PHP3] a list of an array of objects"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In article <3911B2F5.5105DB50 <email protected>>, darcy <email protected> ("darcy w.
christ") wrote:
> after searching around, i discovered that i could use each to get the
> key/value pairs for an array of objects. i'm working with what is
> returned from mysql_fetch_object. What i am trying to do is to clear
> all entries for a particular array of objects. i've started by parsing
> out the objects in a while loop:
>
> while(list($index,$object) = each($this->row)) {
> $this->row[$index]->$object = ''
> }
>
> unfortunately, this doesn't seem to work. i get a parse error. Is
> there a better way to loop through this array and either unset or empty
> the values of that object?
I dunno if unset() works on an object returned by mysql_fetch_object.
The double-dereference won't work in PHP3, only PHP4 (I think).
So what Cynic wrote will probably work.
But before we go too much further...
My gut is telling me that you should have been able to write some SQL to
make MySQL return only the records you want instead of getting a bunch of
extra ones and unsetting them after you've gotten them.
Databases have been optimized like crazy to do this sort of thing, and
unless there's some really esoteric PHP functionality to determine what to
throw out, you are way mo' betta off letting the database
filter/sort/search and return the right records.
-- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribe <email protected> To subscribe to the digest, e-mail: php3-digest-subscribe <email protected> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Richard Lynch: "Re: [PHP3] Can't get data from query"
- Previous message: Richard Lynch: "Re: [PHP3] converting from hexidecimal to decimal, and vice-versa."
- In reply to: darcy w. christ: "[PHP3] a list of an array of objects"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

