Is this possible Selecting distinct rows from a table column and count repeated row for each distinct fields in a single query
$sql = "SELECT DISTINCT location and COUNT(DISTINCT location)
FROM ".$db_name.".$table_name
ORDER BY location ASC
LIMIT ". $start_page.",". $recordPer_page."";