mysql order-by original "where order"

Posted by Benjamin Dobnikar on Stack Overflow See other posts from Stack Overflow or by Benjamin Dobnikar
Published on 2012-04-15T17:03:20Z Indexed on 2012/04/15 17:29 UTC
Read the original article Hit count: 312

Filed under:
|
|
|
|

I have this order-by problem I canot crack. I select from my table like this:

SELECT * FROM 'sidemodules' WHERE name = 'module1' OR name = 'module2' OR 'name3'

Which returns me the modules I want. But the modules lie the table, say in this order:

  1. module3
  2. module1
  3. module2

And they are returned to me in this order. How can I get them to display in order AS IN THE WHERE CLAUSE (1,2,3) ?

Big thanks!

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql