Jump to content

[SOLVED] Sorting query in order of id array


unxposed

Recommended Posts

I have a mysql query where I'm selecting modules using an array of module id's. These are already in the order which I'd like the rows ordered by, which isn't neccesserily logical (i.e. - could be 24, 2, 7, 1, 3, 15, 10). Buty I just have no idea what to put in the ORDER BY field.

 

$query = "SELECT * FROM modules WHERE mid IN ('".implode("', '", $mids)."') ORDER BY mid ?? ";

 

Many thanks!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.