gijew Posted December 29, 2006 Share Posted December 29, 2006 So I'm trying to figure out the easiest / best way to do this and I think I'm over complicating this so I need help here.I'm pulling records from a table using the RAND() function. I soon realized when the user submitting the form it would randomize the record set again unless I specifically told it to chose the records from the first query. I have that working BUT I'm getting stuck on the ORDER BY part of it all which I didn't think about.A query would look like this:SELECT question_id, question FROM certification_questions WHERE question_id IN (3,4,1)If I tried to order them by record 3,4,1 I get a mySQL error because well, you can't order by the field value, just the field (at least from what I know) SO I'm kind of lost on how to order the records by 3,4,1.Any insight here on how best to accomplish this? Link to comment https://forums.phpfreaks.com/topic/32188-solved-order-records-by-value-not-field/ Share on other sites More sharing options...
gijew Posted December 29, 2006 Author Share Posted December 29, 2006 Using asort() after the query worked since I'm using adodb. Guess I just needed to push my brain. I'm going to lie down after that brain buster... Link to comment https://forums.phpfreaks.com/topic/32188-solved-order-records-by-value-not-field/#findComment-149423 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.