sseeley Posted March 9, 2009 Share Posted March 9, 2009 Hi I currently have all my records within my database encrypted for data protection etc...when I retrieve these records, I cannot sort them A-Z using MYSQL as I do not decrypt them until they are displayed. Is there an easy way of sorting records within PHP to allow me to display them in alphabetical order? Many thanks in advance. Link to comment https://forums.phpfreaks.com/topic/148600-sorting-records/ Share on other sites More sharing options...
PFMaBiSmAd Posted March 9, 2009 Share Posted March 9, 2009 Your would need an additional column that holds enough information about the actual data that you could do an ORDER BY using that column. Link to comment https://forums.phpfreaks.com/topic/148600-sorting-records/#findComment-780348 Share on other sites More sharing options...
Mark Baker Posted March 9, 2009 Share Posted March 9, 2009 Encrypting every column in your database isn't necessarily good practise; and rather negates the whole point of using a database, making indexed access and sorting extremely difficult. It's far better to secure access to your database. Link to comment https://forums.phpfreaks.com/topic/148600-sorting-records/#findComment-780352 Share on other sites More sharing options...
kickstart Posted March 9, 2009 Share Posted March 9, 2009 Hi You could read them into a 2 dimensional array (first dimension being the record number, 2nd being the field) and then sort the array before processing them. Be fine for a limited number of records. I have done this for things like a list of users taken from multiple seperate databases. All the best Keith Link to comment https://forums.phpfreaks.com/topic/148600-sorting-records/#findComment-780359 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.