Code: Select all
$result = mysql_query ("SELECT id, catid, catname FROM products WHERE pause = 'off' AND catid IS NOT NULL AND pause = 'off' GROUP BY catname ORDER BY
catname='test1' DESC,
catname='test2' DESC,Moderator: General Moderators
Code: Select all
$result = mysql_query ("SELECT id, catid, catname FROM products WHERE pause = 'off' AND catid IS NOT NULL AND pause = 'off' GROUP BY catname ORDER BY
catname='test1' DESC,
catname='test2' DESC,Code: Select all
SELECT id, catid, catname FROM products
WHERE pause = 'off' AND catid IS NOT NULL
ORDER BY catname DESC, id DESCThat sounds like two queries: one for "certain names" and on for everything else but "certain names" -- each sorted differently.simonmlewis wrote:I want to order by certain names, then after than by catname in alpha order
Ohhhhh ... I've known that from the start!simonmlewis wrote:Nooo you really don't get it.
If you do "ORDER BY catname" it will order the list by catname, but if two values have the same value in catname then it will order them depending on how they are fetched from the specific database you are using. For all practical purposes there is no order, and you should not consider there to be one. You need to give it a second value in the ORDER BY clause, such as "ORDER BY catname, title".simonmlewis wrote:So - we order and place them in specific orders by the "catname" extracted. But after it's found five of them, I want to know what order it puts the rest in. ID, Title, or randomly, how does it do it?