Hi,
Whats the best way to count the total about of records contained inside a table?
Try This:
$query = "SELECT count(*) AS total FROM `table`"; $result = mysql_query($query); $data = mysql_fetch_assoc($result); echo $data['total'];
Use previously suggested method or use the mysql_num_rows() function as shown below
$result = mysql_query("select * from tbl"); $num = mysql_num_rows($result); echo $num; echo '</td></tr>';