xwishmasterx Posted May 27, 2012 Share Posted May 27, 2012 Hi I have some rows where all of them contains a 'te_group' value. I'd like to show all the rows under each group eg: te_group id name ------------------------------------ group1 2 name1 group1 5 name5 te_group id name ------------------------------------ group2 4 name2 group2 7 name3 can I does this just by using order or group by? The te_group value can be anyhing so I cannot use "WHERE te_group=x" hope you understand my question Quote Link to comment https://forums.phpfreaks.com/topic/263197-order-or-group-using-while-loop-how-can-i-get-this-output/ Share on other sites More sharing options...
requinix Posted May 27, 2012 Share Posted May 27, 2012 Use an ORDER BY. When you loop through and print out the results you can group them together. Quote Link to comment https://forums.phpfreaks.com/topic/263197-order-or-group-using-while-loop-how-can-i-get-this-output/#findComment-1348909 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.