They give the same result, so which one is better/faster to use?
Printable View
They give the same result, so which one is better/faster to use?
Depends upon your needs/use.
Quote:
Note: If you already have a $result, use mysql_num_rows() on it otherwise use SQL count(). Don't SELECT data just for a count.
SQL count or PHP count? I believe the latter calls mysql_num_rows internally when passed a MySQL result set.
sql count. I went with sql count so that is puts the overhead on the DB