Ok, let\'s say I have a table with photos.
What I want to do is on a page display the photo based on the id in the URI. Bellow the photo I want to have 10 thumbnails
I resolve this by using the below code:
SELECT A.* FROM ( ( SELECT * FROM gossips WHERE id < 7 ORDER BY id DESC LIMIT 2 ) UNION ( SELECT * FROM gossips WHERE id > 7 ORDER BY id ASC LIMIT 2 ) ) as A ORDER BY A.id