j.smith1981 Posted August 16, 2011 Share Posted August 16, 2011 I am sorry if this has been covered before just the examples given are way more complex than what I need really. I was wondering how I would go about sorting the following list here (as it's displaying at this very moment): Original Product 1 Original Product 2 Compatible Product 1 Compatible Product 2 I would like (or need rather) the products to be displayed like so: Original Product 1 Compatible Product 1 Original Product 2 Compatible Product 2 (essentially the Original appears first for that given product and then the comparitive Compatible, I am dealing with Printer Cartridges here, but this should be enough of an example to illustrate what I am aiming for). How would the ORDER BY clause look, I mean I know it's a substr on the first space, just not exactly sure about how to go about getting this clause working, tried a few times but it fails each time. Any helps massively appreciated! Jeremy. Link to comment https://forums.phpfreaks.com/topic/244909-sorting-mysql-results-by-a-given-prefix/ Share on other sites More sharing options...
j.smith1981 Posted August 16, 2011 Author Share Posted August 16, 2011 I must apologise, this has been solved before by my own question woops! Really not awake today: http://www.phpfreaks.com/forums/index.php?topic=325907.msg1534555#msg1534555 Link to comment https://forums.phpfreaks.com/topic/244909-sorting-mysql-results-by-a-given-prefix/#findComment-1258055 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.