Back to Articles

Mysql count

Posted in By On 26th Oct 2009

  1. <?php
  2.  
  3. // connect to the database first
  4.  
  5. dbconnection();
  6.  
  7. // query
  8. $result = mysql_query("SELECT * FROM tablename");
  9.  
  10. $rows = mysql_num_rows($result);
  11.  
  12. // results
  13. echo $rows;
  14.  
  15. ?>
Comments (Using Facebook Comments)
1 of 1