MySQL Forums
Forum List  »  PHP

Fastest way to find total count
Posted by: natio struction
Date: February 08, 2006 07:39AM

Hey Guys,

I was just wondering which way you feel is the best to find the total rows from a table.

This is what I usually use:

$query = mysql_query("SELECT `id` FROM `table`");
$total = mysql_num_rows($query);


Thing is when it brings out over a 1000 rows I would think there would be a faster way to do this.

Any feedback on this would be great. Thanks!



Edited 1 time(s). Last edit at 02/08/2006 07:39AM by natio struction.

Options: ReplyQuote


Subject
Written By
Posted
Fastest way to find total count
February 08, 2006 07:39AM
GDH
February 08, 2006 09:30AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.