Sorting encryted data
Posted: Wed Sep 13, 2006 6:06 am
Hi Guys,
I have some code that returns encrypted data from a database, as follows:
Currently certain fields are encrypted and a I have a small object called crypt() that decodes it correctly.
So when I output a value that is encrypted I do:
The problem I have is that I cant sort the data properly as the SQL statement above simply sorts the enrypted data.
Can anybody suggest the simplest way I could decrypt the data and sort it before it is output?
I have some code that returns encrypted data from a database, as follows:
Code: Select all
$sql = $database->query("SELECT * FROM `email` WHERE `CompanyID`='{$_SESSION['CLIENT']['ID']}' AND `Type` != 'Forwarder' ORDER BY Type ASC, Address ASC");
while($email = $database->fetch_assoc($sql))
{
... etcSo when I output a value that is encrypted I do:
Code: Select all
echo $crypt->decrypt($email['Address']);Can anybody suggest the simplest way I could decrypt the data and sort it before it is output?