2008年12月18日星期四

RE: [fw-db] Mysql PDO: Selecting DES encrypted fields

Hello Dan,

Try this:

$st_addr = new Zend_Db_Expr('DES_ENCRYPT(street_address)');
$d = $db->fetchRow("SELECT " . $st_addr . ",city,state,zip_code,orderID FROM
registration
WHERE orderID=?", array($OrderID));
print_r($d);

hope this works, regards!

-----Mensaje original-----
De: dan k [mailto:dkilgore@highlandsolutions.com]
Enviado el: Jueves, 18 de Diciembre de 2008 11:48 a.m.
Para: fw-db@lists.zend.com
Asunto: Re: [fw-db] Mysql PDO: Selecting DES encrypted fields


Thanks for the quick response,
Unfortunately, that doesn't seem to be what I'm experiencing here. I am able
to run the same queries directly on the mysql server and through PEAR's DB
module successfully. I will keep digging.


Piotr Kabacinski wrote:
>
> Hello, it doesn't look to be related to Zend_Db, maybe this link will
> help you.
> http://bugs.mysql.com/bug.php?id=10589
>
> dan k wrote:
>> Hey,
>> I have searched and have not found any discussion about this. I'm
>> attempting
>> to select fields that were encrypted with DES_ENCRYPT for example:
>>
>> $d = $db->fetchRow("SELECT
>> DES_DECRYPT(street_address),city,state,zip_code,orderID FROM registration
>> WHERE orderID=?", array($OrderID));
>> print_r($d);
>>
>> Prints out:
>>
>> Array
>> (
>> [DES_DECRYPT(street_address)] =>
>> [city] => TestCity
>> [state] => IL
>> [zip_code] => 12345
>> [orderID] => 326829
>> )
>>
>> So the unencrypted fields are returned correctly, but the DES_DECRYPT
>> fields
>> are always empty. Has anyone had any luck using DES encryption with
>> Zend_DB?
>
> --
> Piotr Kabacinski
> a2Fib3Q
>
>

--
View this message in context:
http://www.nabble.com/Mysql-PDO%3A-Selecting-DES-encrypted-fields-tp21077365
p21077634.html

Sent from the Zend DB mailing list archive at Nabble.com.

没有评论: