In my database, I have a table "clients" In the table, it stores their name, email, etc, etc. I am trying to write something simple to display the number of clients that are in my database so that on my php page I can have something like: Total number of clients: $totalclients Ive been messing around and searching and cant find the solution to this simple problem.
you need to make a query with that string. $sql = "SELECT COUNT(*) AS client_count FROM clients_table"; $result = mysql_query($sql); $row = mysql_fetch_assoc($result); echo "Total clients: ".$row['client_count']; Code (markup):