Counting num of rows in PHP+ MySQL

PythonPython Forum LeaderThe Royal RAM
How can I find out how many rows there are in a MySQL table in PHP?

I know that it could be done by using a while statement and then just incrementing a variable on each loop round... but is there a better way?

The Royal Ram

Comments

  • ForgeForge Senior Member The Royal RAM
    of course there is. $rows = mysql_num_rows($result);

    $result variable is just the mysql_query() thing, change it your your normal variable.
    Can fat people Go skinny Dipping?
  • PythonPython Forum Leader The Royal RAM
    aha. ok thanks :)

    The Royal Ram

Sign In or Register to comment.