most efficient way...

admin

Administrator
Staff member
i have a rather huge database and i need the best way to be able to query it to inform whoever is visiting the website of how many total 'entries' are in currently in the database.. right now i have:

function totalvisits() {
global $DB_CONF;

// returns number of visits
$total = '0';


$sql = "SELECT count(id) FROM {$DB_CONF["lyric_log"]}";
$sql_result = mysql_query($sql) or die ("Couldn't execute query. (pendingadd()) ".mysql_error());
if ($sql_result) {
$total = mysql_result($sql_result,0,"count(id)");
mysql_free_result($sql_result);
}
return $total;

}


thanks,

kyle
 
Back
Top