Jump to content

sql order ?


drisate

Recommended Posts

I'm definitely not a professional programmer (yet ;D). But you have asked a fairly difficult question... In my opinion, I think it'd be fine to get all the results and translate them to real characters and then sort them in an array... Tons of ways of doing THAT. But it sounds like a good method to me! If anyone's got a better idea, please suggest :S.

Link to comment
https://forums.phpfreaks.com/topic/176609-sql-order/#findComment-931030
Share on other sites

Yeah thats what i thought too ... but i was hopping for a magique function that would encode the col directly in the SQL line ... :-(

 

something like

 

SELECT * FROM lexique WHERE ( titre like 'Â%' or titre like 'À%' or titre like 'â%' or titre like 'à%' or LOWER(titre) like 'a%' ) order by html_entity_decode(titre) asc limit 0, 15

Link to comment
https://forums.phpfreaks.com/topic/176609-sql-order/#findComment-931035
Share on other sites

I'm no expert either, but I don't think it will be possible. Personally I'd have thought the only way to successfully achieve the order would be to store the actual character in the database, not the html encode. Depending on the amount of records you could probably fetch the data then write a custom sort with PHP, or sort it after substituting the values, but if your doing that you may aswell store them in the db.

Link to comment
https://forums.phpfreaks.com/topic/176609-sql-order/#findComment-931047
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.