|
-
Jul 28th, 2001, 10:32 PM
#1
fetch_object, fetch_array?
This is a PHP question..
I know how to use both mysql_fetch_object() and mysql_fetch_array().
PHP Code:
//query goes here, put the result into $res
while($row = mysql_fetch_object($res))
{
echo $row->fieldname;
}
//query goes here, put the result into $res
while($row = mysql_fetch_array($res))
{
echo $row["fieldname"];
}
Both of those would produce exactly the same output, but I am wondering which one is more efficient. I would assume fetch_array is quicker since it doesn't have have any OO overhead, but I'm not sure how much quicker, if it's only a small difference, I may be able to justify using it for the readability.
Thanks,
-Dennis
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|