Getting data in a certain order using mySql
mysql, php
Solution
You can sort like this:
ORDER BY IF (type = 'MX', 1, 0), type
Problem
I'm busy writing a PHP app that gets data from a database, but I need to get the data in a certain order. My Query looks as follows ``` $sql = "select id,title,type from campaigns where id=$cid order by type"; ``` Now my problem is these are the different types 'GC','MJ','MU','MS','MW','MX','GS' and I want MX to always be select last, thus should always be at the end of the row. So the others shpould firstly be selected and then MX. I hope this makes sense.