I want to grab a single row from a table.
I want to be able to specify the row number.
If I use mysql_data_seek(MYSQL_BOTH, 2) it starts at 2, but keeps going.
What if I only wanted to grab the second row?
Help!
Use the LIMIT commad with an offset
LIMIT [offset,] row_count
So to get the second row
SELECT * FROM table LIMIT 1,1
To get the third
SELECT * FROM table LIMIT 2,1
And so forth
That works great 🙂 But now what if I want to make one of the LIMIT values a variable?
i.e.
"SELECT * FROM table LIMIT ".$row.",1";
What is the proper syntax or is there even a way to do this??
Sorry 😛
I figured it out
I had my equal signs mixed up, so it wasn't working properly 🙂
Thanks!