Jump to content

customised sort of database results


chiprivers

Recommended Posts

Is there away to customise the order inwhich results are returned form a database? other than just the standard ASC or DESC of a column?

I have a database that contains a set of records, one column holds a ref number that starts with either a B, A, G or S followed by a number.  When the results are returned, I want to display the records in an order first sorted by the letter but in the order given ( B A G S ) then ascending numerical order of the following digits that make up the ref.

Is there a way to do this, either within the MySQL query statement or in PHP once the results are returned?
Link to comment
https://forums.phpfreaks.com/topic/33447-customised-sort-of-database-results/
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.