0

I have counter $i in my php page , so i want to get the next 15 records right from that $ith row. I am just using the below query bt it is returning empty output. I have plenty of records in db though

SELECT * FROM BOOKS WHERE @ROWNUM > '$i' LIMIT 15 
1
  • 2
    why dont you use offset with limit Commented Jan 12, 2013 at 7:29

2 Answers 2

3

If I understand you right, you want to show 15 rows starting from $i ?

Try:

SELECT * FROM tbl_name LIMIT $i,15
Sign up to request clarification or add additional context in comments.

Comments

1

You can build a query as

SELECT * FROM BOOKS LIMIT $i, 15;

Check this link MySQL SELECT with LIMIT

2 Comments

change it to SELECT * FROM BOOKS LIMIT $i, 15;
Changed as you have specified

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.