I am looking to return the 2nd, or 3rd, or 4th record from a MySQL query (based on a query by ID ascending)
The problem being, I won't know the ID, only that it is the 3rd row in the query.
I am looking to return the 2nd, or 3rd, or 4th record from a MySQL query (based on a query by ID ascending)
The problem being, I won't know the ID, only that it is the 3rd row in the query.
SELECT * FROM table ORDER BY ID LIMIT n,1
should work. It says return one record starting at record n.
Use the limit clause (add 'limit 3, 1' to the end of your query to only select the third row).
Here's some more information: http://php.about.com/od/mysqlcommands/g/Limit_sql.htm