Snippet Name: Counting rows
Description: A very fast way to get the number of rows in a table is doing this.
Comment: (none)
Language: MYSQL, PHP
Highlight Mode: MYSQL
Last Modified: February 28th, 2009
|
$total = mysql_result(mysql_query("SELECT COUNT(id) FROM yourtable"),0); |