chewwy Posted July 25, 2006 Share Posted July 25, 2006 i'm not sure if this could be done in SQL itself, i don't think so, so i'll ask here.right. i have 6 columns of data in a MySQL table which i want to group all together, then sort alphabetically, while remembering what row of the table they belong to (i.e. there could be a 7th column, a number, and there'd be 6 pieces of data attahced to that number. help the noob?the alternative would be to have just 2 columns, with each number repeated 6 times. then i could sort them easily in SQL, and not have to resort to PHP. however i'm a little too far down the road to do that... Quote Link to comment https://forums.phpfreaks.com/topic/15578-grouping-arrays-sorting/ Share on other sites More sharing options...
king arthur Posted July 25, 2006 Share Posted July 25, 2006 So you want to get all the data, from all the columns and rows, and sort the whole lot alphabetically while remembering which row each bit of data came from? If that's the case I think I would look at building a temporary table and doing the sort on that, I don't know if that's the best solution. Quote Link to comment https://forums.phpfreaks.com/topic/15578-grouping-arrays-sorting/#findComment-63355 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.