Efficiency question
| From: | Micah Stevens | Date: | Fri, 27 Jun 2003 02:04:27 +0000 |
| Subject: | Efficiency question | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-28934@lists.php.net to get a copy of this message | ||
I would guess that:
$data = mysql_fetch_assoc(mysql_query("select * from some_table limit 1"));
would be faster than:
$pointer = mysql_query("select * from some_table limit 1");
$data = mysql_fetch_assoc($pointer);
but I'm not sure, php may optimize this. Anyone know the answer?
I'm taking over some code that someone else made that has a lot of one record
retrevals coded in it, like option 2, and I was wondering if it was worth my
time to change it.
Thanks!
-Micah