1
$criteria->order = 'patient_admit_details.first_name DESC';
$criteria->group = 'Patients.patient_id';
$dataProvider = new CActiveDataProvider('Patients', array('criteria'=>$criteria));

The patient's first name and last name were stored in the database using base_64 encoding. Now how can I get patients in sorted order using first_name? Sorting should be applied to original values. Is there any provision from CActiveDataProvider? I don't want to loop over every record, decrypt and sort patients.

Lakshman
  • 47
  • 7
  • There is a function https://dev.mysql.com/doc/refman/5.6/en/string-functions.html#function_from-base64 in MySQL, maybe you can use it in `ORDER BY`? Not sure :) – Damian Dziaduch Mar 30 '20 at 08:56

0 Answers0