@bravogolf
in a 2006 thread (thread434-1203802) i believe that the answer has now changed. for example
in the above the number of rows can be obtained from the library function which, as you see, is independent of the limit query actually run. it is also markedly more efficient since the resultset of the unlimited query does not need to be passed to the client. the essential thing is to insert the SQL_CALC_FOUND_ROWS field in your sql code.
hope that helps.
in a 2006 thread (thread434-1203802) i believe that the answer has now changed. for example
Code:
$query = "select id, name, SQL_CALC_FOUND_ROWS from tablename offset 10 limit 10";
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result)){
//do something with the recordset
}
echo "Number Rows = ".getNumberRows();
function getNumberRows(){
return mysql_result(mysql_query("select found_rows()"), 0, 0);
}
in the above the number of rows can be obtained from the library function which, as you see, is independent of the limit query actually run. it is also markedly more efficient since the resultset of the unlimited query does not need to be passed to the client. the essential thing is to insert the SQL_CALC_FOUND_ROWS field in your sql code.
hope that helps.