Hi
i have a news table. I am using the query "select * from news_table where news_id in(8,3,6,1)". This query is working properly. But the problem is i need to return the rows in the same order what we give in the 'in' clause. ie, first record with news_id 8 then 3 then 6 and so on...Is it possible? Pls help me...very urgent...
ditty
0
Light Poster
Recommended Answers
Jump to PostI think you should use order by clause. And if that does not fit your requirement then
you may put them in an array and do a loop using the array and fetch one by one row from the database.
GdLuck
All 4 Replies
mahavir123
1
Junior Poster in Training
ditty
0
Light Poster
smantscheff
265
Veteran Poster
mahavir123
1
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.