There are two ways that i used to view the MySql number of rows.
The first method is to use the php function: mysql_num_rows()
View Code PHP
$rows = mysql_num_rows(mysql_query('SELECT id FROM accounts')); echo $rows; |
The second method is to use the mysql function: count() which is faster
View Code PHP
$rows = mysql_fetch_row(mysql_query('SELECT count(id) FROM accounts')); echo $rows[0]; |