how can you print up the number of rows in a table in a MySQL database? working on a little admin thing for my school, and i want to make a statisic thing so my teacher knows everything, but i dont know how i would print up the rows.
$result = mysql_query("SELECT * FROM table"); $num_rows = mysql_num_rows($result);
If you don't need the result of the query you can also do that:
$num_rows = mysql_fetch_row(mysql_query("SELECT count(*) FROM table")); echo $num_rows[0];