richiejones24 Posted November 12, 2011 Share Posted November 12, 2011 Any ideas how to get my premium profiles to display first in the search results? by using the MySql ORDER BY? I have added a field to my table call premium if the profile is a premium profile it has "1" in it. I have being trying all night to get it to work, but it is still not working :-( Quote Link to comment https://forums.phpfreaks.com/topic/250986-mysql-order-by/ Share on other sites More sharing options...
laPistola Posted November 12, 2011 Share Posted November 12, 2011 Probably need more info but if I understand you just need to use a comma on your ORDER BY clause eg: ORDER BY premium, name ASC How ever you will need to switch the code value. If its a premium profile then it needs to be 0 and if not a 1. Quote Link to comment https://forums.phpfreaks.com/topic/250986-mysql-order-by/#findComment-1287594 Share on other sites More sharing options...
fenway Posted November 13, 2011 Share Posted November 13, 2011 You can also order by the expression ( premium = 1 ). Quote Link to comment https://forums.phpfreaks.com/topic/250986-mysql-order-by/#findComment-1287784 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.