Please check out the new Help Developer forum

Show Sidebar

Count number of records in MySQL database

March 26, 2008

There may be a time when you need to output the number of records you have in a MySQL table, say for example if you are hosting images, it would be nice to tell your users how many images you have on your site.
This can be achieved simply with the following code:

<?php
$result = mysql_query(”SELECT * [...]