Archive

Posts Tagged ‘Mysql COUNT’

Mysql Query – Get Number of Rows in a Mysql Database Table

March 5th, 2009 No comments
Mysql Query – Get Number of Rows in a Mysql Database Table 1'st Solution, use Mysql COUNT(*) : $sql = "SELECT COUNT(*) FROM my_table"; $result = mysql_query($sql); $num = mysql_result($result, 0); echo $num; 2'nd solution: use TABLE_ROWS and TABLE_NAME from information_schema: $query = "select TABLE_ROWS from information_schema.tables where table_schema = 'my_data_base' AND TABLE_NAME = 'my_table' "; $result = mysql_query($query); $count ...
GoCache - ByREV-Cache v1.0 - live served in : 0.408747 sec (gzip)