im trying to do something like this: $query = "SELECT * FROM likes LIMIT $begin,$end"; I want to get results $begin through $end. for example, $begin can be 0 and $end would be 15. I am trying to say give me rows 15 through 30. how do i do that using variables in sql?
Hello, Your query is more or less OK. Only small mistake is that the second parameter is not the "end", but the number of results. For example, SELECT * FROM mytable LIMIT 5,10; # will retrieve rows 6-15 Code (markup): This means that if you want to retrieve all rows from 15 to 30 (included), that you need the query SELECT * FROM mytable LIMIT 14,16; Code (markup):