Currently I have an sql query which finds the amount of records in the database for a specific person (Ms White), how can I repeat the function for every surname within the table and print them out in a sensible format?
$query = "SELECT COUNT(Surname) FROM Customers WHERE Surname='White'";
Wouldn’t it be better to run just one query with the
countper each surname?This will return results like this: