I am confuse on how to limit selection in MySQL (e.g SELECT * FROM tblProduction LIMIT 1,N;) where N is unknown.. Can anyone help me on how can I limit the selection in MySQL? I want to show the records starting from row 2 (two) up to the end of the records. Thanks开发者_运维知识库!
This is from the LIMIT documentation:
To retrieve all rows from a certain offset up to the end of the result set, you can use some large number for the second parameter. This statement retrieves all rows from the 96th row to the last:
SELECT * FROM tbl LIMIT 95,18446744073709551615;
EDIT: So in your case you would just change 95 to 2. Then you would get all rows starting from the 2 result.
Hi you can either pass the N
value by Query string or some cookie.
"SELECT * FROM tblProduction LIMIT 1,".$_GET[Limit];
精彩评论