Yes, I'm querying and counting results:
$sqlresult =mysql_query("SELECT DISTINCT surname FROM $database",$connection)
or die("Couldn't run query.");
$surnames = 0;
$surnames = mysql_num_rows($sqlresult);
echo $surnames;
$sqlresult =mysql_query("SELECT * FROM $database",$connection);
or die("Couldn't run query.");
$records = 0;
$records = mysql_num_rows($sqlresult);
echo $records;
I've heard about indexing and how it is supposed to help speed things up, but I don't know how to implement it.
Since the surname query has to collect DISTINCT results, it is probably taking longer than it needs to.
Also, since I really just need the info in the ID field for the last record in the DB to get # of records, I should probably just grab that number and not have to run through the whole database right?
How can I do that efficiently?
Thanks,
A