Find the total records in a mysql table – PHP

<?php
mysql_connect(“localhost”,”root”,”password”);
mysql_select_db(“store”);
$total=mysql_num_rows(mysql_query(“SELECT category_id as total FROM category”));
echo $total;
?>

Leave a Reply

Your email address will not be published. Required fields are marked *