Mysql Custom Order Alphabetically and Alphabetically:

I am using the following query:

$query = "SELECT * FROM `$table[$a]` ORDER BY FIELD(typeof,'pdf','swf','img','web')";

to select and organize my mysql query, it works fine, except that there are several files in each type, and now I want to order them in alphabetical order, but keeping their order type. It makes sense?

+5
source share
3 answers
SELECT * FROM `$table[$a]` 
ORDER BY 
  FIELD(typeof,'pdf','swf','img','web'), --first order by type
  filename  --then by filename
+9
source
$query = "SELECT * FROM `$table[$a]` ORDER BY FIELD(typeof,'pdf','swf','img','web'), name ASC";

Not sure if this will work

+2
source
... ORDER BY FIELD(typeof,'pdf','swf','img','web'), name
+2
source

All Articles