I'll give Zend_Db_expr a try.
I found that my issue was with how my sql servers were set up. I was pulling
data from my beta server but the server I was using to test had a different
key file so all the decrypts were failing. I completely fooled myself
because when I was running the queries manually it was on data that was
encrypted by the test server so it worked. %-|
Thanks guys, it looks like zend_db handles this stuff like a champ.
Jaime Garcia-2 wrote:
>
> 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.
>
>
>
>
--
View this message in context: http://www.nabble.com/Mysql-PDO%3A-Selecting-DES-encrypted-fields-tp21077365p21080910.html
Sent from the Zend DB mailing list archive at Nabble.com.
没有评论:
发表评论