I am trying to use PHP to get MySQL to skip the first 5 entries into a table called “blog” and then list the 6th to 10th entry.
What I mean is if there is 10 entries in the table “blog” with “id” -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, I want PHP to skip all entries of “id” 6 to 10 and then echo “id” 1 to 5.
This is currently the code I have. How should I edit this to implement that?
$sql="SELECT * FROM blog ORDER BY id DESC;";
$result=mysqli_query($mysqli,$sql);
Thanks!
LIMITis used for exactly this. Its usage is described in the article onSELECTin the MySQL documentation.