I've been trying to get for examples rows 100 through 200 from a table of 1000+ rows. I found this snippet online that seems to work perfectly in PHPMyAdmin but when I try to use it in code, it won't work.
SELECT *
FROM (
SELECT
@row := @row +1 AS rownum, id
FROM (
SELECT @row :=0) r, myGames
) ranked
WHERE rownum >= 100 AND rownum < 200"
Here is my PHP Code
$q = "SELECT *
FROM (
SELECT
@row := @row +1 AS rownum, id
FROM (
SELECT @row :=0) r, myGames
) ranked
WHERE rownum >= 100 AND rownum < 200";
$query = mysql_query($q);
When I try to do $query = mysql_query($q) or die(mysql_error()), I get nothing.
Any help with this is greatly appriciated
EDIT: SOLVED by using LIMIT 100,100. Thanks guys