k0z Posted September 10, 2009 Share Posted September 10, 2009 Lets say i have a table, and within this table i have the following Fields: Field 1: a Field 2: a_column Field 3: b Field 4: b_column Field 5: c Field 6: c_column The Fields without the _column on the end ONLY contain a numerical value 1-10, which represents what order they should display in. The Fields WITH _column on the end contain either "left" or "right", which determine which column (left or right) to display in. My question is, how can I determine which is which. So for example, if the Fields contained these values: Field 1: a = 1 Field 2: a_column = "left" Field 3: b = 1 Field 4: b_column = "right" Field 5: c = 2 Field 6: c_column = "right" How would I determine the following: Left column: First: a -- Right column: First: b second: c Thanks for your time. Link to comment https://forums.phpfreaks.com/topic/173730-data-orderingsql-question/ Share on other sites More sharing options...
kratsg Posted September 10, 2009 Share Posted September 10, 2009 mysql_query("[sELECT STATEMENT HERE] ORDER BY `field1` ASC"); Link to comment https://forums.phpfreaks.com/topic/173730-data-orderingsql-question/#findComment-915781 Share on other sites More sharing options...
k0z Posted September 10, 2009 Author Share Posted September 10, 2009 Edit: not sure how i can use that to make this work? Link to comment https://forums.phpfreaks.com/topic/173730-data-orderingsql-question/#findComment-915784 Share on other sites More sharing options...
kratsg Posted September 10, 2009 Share Posted September 10, 2009 Edit: not sure how i can use that to make this work? What is the name of the column? Link to comment https://forums.phpfreaks.com/topic/173730-data-orderingsql-question/#findComment-915791 Share on other sites More sharing options...
k0z Posted September 10, 2009 Author Share Posted September 10, 2009 Edit: not sure how i can use that to make this work? What is the name of the column? Dont know what you mean here. I listed the names of the fields in the first post. Link to comment https://forums.phpfreaks.com/topic/173730-data-orderingsql-question/#findComment-915794 Share on other sites More sharing options...
kratsg Posted September 10, 2009 Share Posted September 10, 2009 Can you screenshot what your table (with data) looks like perhaps? Link to comment https://forums.phpfreaks.com/topic/173730-data-orderingsql-question/#findComment-915836 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.