I am trying to only select the difference between $from and $to and have those rows outputted in descending order. The problem so far is that I am inputting ‘5’ in as the $from value and ’10’ into the $to value, but it seems to be outputting 10 rather than 5.
Please could you tell me where I am going wrong?
$query = mysql_query("SELECT * FROM `Posts` WHERE `isPublic` = 'yes' ORDER BY `date` DESC LIMIT $from,$to") or die(mysql_error());
Check this out: SELECT MySQL documentation.
What you are doing by
LIMIT 5, 10is a synonym toLIMIT 10 OFFSET 5(get 10 results skipping 5 results from the beginning of the set returned by database).