hi everyone, i have a SQL query and i want to simplificate him. php code $result=mysql_query("SELECT * FROM products WHERE cid='$cid' AND status=1 ORDER BY $sort"); $rows=mysql_num_rows($result); $result=mysql_query("SELECT * FROM products WHERE cid='$cid' AND status=1 ORDER BY $sort LIMIT " . ($pg-1)*$limit . ",$limit"); $NumberOfPages=ceil($rows/$limit); PHP: can anybody help me? i want to use 1 SQL query. not 2 like above. thanks in advance