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
According to the MySQL documentation this is most efficient if you're using a MyISAM table (which is the most usual type of tables used):
$result = mysql_query("SELECT COUNT(*) FROM table");
Otherwise you should do as Wayne stated and be sure that the counted column is indexed.