1

How do I output data from column, but to be like.. for example - the column is with 40 lines of query results and I want to output only that, that are from 10 to 30 . How to do it with PHP?

4
  • What does your database table look like? Also, if you can provide the code you have so far, that'll give us a better idea about what you're trying to accomplish. Commented Feb 9, 2011 at 15:13
  • What do you mean with a column? Are you trying to limit the amount of data you see of your database? Try using SQL's limit for that. Commented Feb 9, 2011 at 15:13
  • not clear, can u add more details, code ... Commented Feb 9, 2011 at 15:14
  • You mean some sort of pagination? or a LIMIT to the query? Commented Feb 9, 2011 at 15:14

1 Answer 1

2

For MySQL, you could use a LIMIT offset, maxrows:

SELECT * FROM tbl LIMIT 9,20;

will get you rows 10-30. Note that the offset value is 0 based, hence the 9 rather than 10.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.