Jump to content

Sorting out two rows


tripper

Recommended Posts

Hello, im using php to manipulate data in mysql and output it onto a site. I want to sort out two rows in a table like example:

 

D  X

F  X

A  O

B  X

E  O

C  O

into something like this

A  O

C  O

E  O

B  X

D  X

F  X

(so you notice that all the names corresponing to 'O' are sorted out ..same with 'X') Any ideas?

Thanks

Link to comment
https://forums.phpfreaks.com/topic/38323-sorting-out-two-rows/
Share on other sites

the data is stored  pretty much like in the example..except the letters A,B,C correspond to the names and O,X is as it is. There are a few more columns in the table, but im only looking at these two.

Iam not sure what you mean by how it is stored. Its just a table with a bunch of columns in Mysql. And Im using php, to ouput that table to a site. I can manage everything else, its just the sorting. First I have to sort out the 'O' and the 'X's then, sort the names within the 'O's and sort the name within the 'X's

Thanks

Link to comment
https://forums.phpfreaks.com/topic/38323-sorting-out-two-rows/#findComment-183665
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.