Whats the most efficient way of selecting total number of records from a large table? Currently, Im simply doing
$result = mysql_query(\"SELECT id FROM table
mysqli_query() is deprecated. Better use this:
$result = $dbh->query("SELECT id FROM {table_name}"); $total = $result->num_rows;
Using PDO:
$result = $dbh->query("SELECT id FROM {table_name}"); $total = $result->rowCount();
(where '$dbh' = handle of the db connected to)