Do you have your own database? How would you like to know how many entries you have in your database from a PHP page? Well its easy, I am going to show you a script that will allow you to create a counter that will count the number of entries you have in your database.
Now let’s say we have an email database, and we want to count the number of emails we have in the database. All we need to do is create this simple script (assuming your database is already made).
We are going to go ahead and assume you are root user, if not use your username and password. (If you have one in MySql)
Connecting to the database
$db = mysql_connect("localhost", "root", "password?);
$sql = "SELECT count(*) from edb"; //->edb is the name of the table
$result = mysql_db_query("emaildb",$sql); //->emaildb is the name of the database
$user = mysql_fetch_row($result);
$user = $user; //->Starts the count at 0
echo "$user Registerd Emails";
//->prints how many registered users there are.