RE: [PHP-DB] How to find out the number of rows in a table?

2002-01-24 Thread Rick Emery
SELECT count(*) AS ctr FROM mytable; -Original Message- From: Andy [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 24, 2002 10:36 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] How to find out the number of rows in a table? Hi there, I am trying to find out the number of rows in a

RE: [PHP-DB] How to find out the number of rows in a table?

2002-01-24 Thread Sam Masiello
Try the following: $sql = select count(*) as c from your_table ; $result = mysql_query(your_db, $sql, your_connection_identifier) ; $row_count = mysql_result($result, 0, 'c') ; Now $row_count contains the number of rows in your table named your_table HTH --Sam Masiello Andy [EMAIL