There are two solution to get total number of records from any table, Here are both explain in brief:
First one is - you can used COUNT() directly to select query like below e.g.
$Qr=mysql_query('select COUNT(*) from tablename');
$Qry=mysql_fetch_array($Qr);
echo $Qry;
It's display total number of records.
--------------------------
Second one is - 'mysql_num_rows' like below e.g.
$Qr=mysql_query('select * from tablename');
$Qry=mysql_num_rows($Qr);
echo $Qry;
It's display total number of records.
Enjoy!
No comments:
Post a Comment