Menu
Hi, I have a database table with name – products -, now I am trying to write a mysql code to show the number of entries in each of the categories in the products table.
Example:
CategoryONE (25)
CategoryTWO (38)
CategoryTHREE (72)
Below is the code I have, so far it not working, I need help.
<?
$table = mysql_query("SELECT count(categories) FROM tb_products GROUP BY id DESC limit 0,1000");
while ($registro = mysql_fetch_array($table)) {
echo "<p>". $registro["categories"] ."</p>
";}
?>