fesan Posted January 14, 2009 Share Posted January 14, 2009 Hello.... I'm printing out some data from my database. Is it possible to Order the outcome by two columns? $query = "SELECT * FROM $dbtable WHERE type = 'Mac 300' ORDER BY type AND nr"; I tried out the code over but it didn't do what i hoped it would do. How i want it: Martin | 1 Martin | 2 Martin | 3 and so on... This is how it comes out now: Martin | 2 Martin | 1 Martin | 3 Quote Link to comment https://forums.phpfreaks.com/topic/140820-solved-order-by/ Share on other sites More sharing options...
rhodesa Posted January 14, 2009 Share Posted January 14, 2009 $query = "SELECT * FROM $dbtable WHERE type = 'Mac 300' ORDER BY type, nr"; Quote Link to comment https://forums.phpfreaks.com/topic/140820-solved-order-by/#findComment-737051 Share on other sites More sharing options...
fesan Posted January 14, 2009 Author Share Posted January 14, 2009 Awsome!!! Thank you for very quick reply!! Quote Link to comment https://forums.phpfreaks.com/topic/140820-solved-order-by/#findComment-737055 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.