$sql = "SELECT COUNT(*) FROM tabla"; $result = mysql_query($sql); $total_registros = mysql_result($result); //total de registros