Mysql: i need to get the offset of a item in a query.

Posted by user305270 on Stack Overflow See other posts from Stack Overflow or by user305270
Published on 2010-04-02T12:27:47Z Indexed on 2010/04/02 12:33 UTC
Read the original article Hit count: 337

Filed under:
|
|
|
|

Mysql: i need to get the offset of a item in a query.

I have a image gallery: this show 6 image per stack, so when i request image 22 it shows images from 18 to 24. It should first get the offset of the image 22, then get the images from 18 to 24.

Another example: i request the image number 62(and offset 62), it will select images with offset from 60 to 66.

Is possible with a single query?

Thanks ;)

© Stack Overflow or respective owner

Related posts about mysql

Related posts about sorting