Forum Moderators: open
I hope someone can help me write this query (MySQL 5)
- I get dynamic value, lets say now its number (5)
then i make a query that will bring me some numbers with this exact order, lets say
(100, 4, 32, 2, 12, 5, 34, 89, 101)
So how can i modify this query so it brings me just one number b4 & one number after my dynamic value which is 5 in this example!
In other words i just want this query to bring me (12, 5, 34)
SELECT id from ads where MATCH (title,desc) AGAINST ('word' IN BOOLEAN MODE) order by date
I know i can get all the values and filter it by PHP, but hope there is a way with SQL to filter the results, but i think its somehow not possible to tell SQL plz save the result starting from the number b4 my dynamic value!
Any inputs are appreciated!
Thanks in advance
Table "ads"
ad_id - title - txt
1 - title1 - txt1
22 - title22 - txt22
43 - ...........
15 - ............
29 - ............
3 - ...............
91 - ...............
88 - .............
73 -.............
etc..
.
then a query will bring up for ex these ad_ids 22 - 29 - 88 - 91 - 3
and ive specific id for ex. 91
so i want my select query to select just the id that is b4 & after this id
so if the id i ve is 91 and my search query would normally bring 22 - 29 - 88 - 91 - 3
then instead of that result, i just want to get 88 - 91 - 3
is it clear now?
[edited by: FalseDawn at 11:24 pm (utc) on July 3, 2007]