$query="SELECT * FROM properties LIMIT 10,6;
if ($result=mysql_query($query) or die (mysql_error()));
$tot=mysql_num_rows($result);
echo "number of records found : " . $tot;
Assume data base will have 50 matching records for the above query.
Now $tot will show 6 records found since we limit the results.
my question is, do we need to run the same query once without the LIMIT command to get the actual total 50? any other solutions ?
This works charm for me !!!
then ill settle with this method folks
$query="SELECT SQL_CALC_FOUND_ROWS * FROM properties WHERE status='1' AND type='$type' ORDER BY dt DESC LIMIT $from,6";
if ($result=mysql_query($query) or die (mysql_error()));
$tot = mysql_query( "SELECT FOUND_ROWS( )" );
echo "found " . mysql_result($tot , 0) . " Records";