Topic awaiting preservation: mysql_fetch_object vs. mysql_fetch_array |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: Milwaukee |
posted 12-04-2002 18:18
Why would I want to use mysql_fetch_object when mysql_fetch_array seems to be more versatile? I use mysql_fetch_object in some cases just because the syntax is a bit quicker to type ($object->property instead of $array["key"]), but arrays allow me to do a lot more. Just wondering if there's some special advantage to returning a result row as an object. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 12-04-2002 18:28
Um not really. It could be usefull if you could extend the class of the object returned but I'm not sure how this would be done for php defined objects. |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 12-04-2002 18:38
there are some (hypothetical) advantages... |
Paranoid (IV) Inmate From: Milwaukee |
posted 12-04-2002 19:11
Well, I'm trying to implement the solution discussed in my previous thread on re-ordering... and I've got some code along the lines of code: // $elements is my result set
|
Paranoid (IV) Inmate From: Milwaukee |
posted 12-04-2002 19:53
Got it! In case anyone cares, the code that worked was code: $final_elements = array();
|