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