开发者

MYSQL: using des decrypt function with lower

I have encrypted user data in my database using des_encrypt, now when i specify a particular statement as below:

SELECT LOWER( DES_DECRYPT( forename, 'ENCRYPT STRING' ) )
开发者_如何学CFROM Users

All the results are NOT returned in lowercase, anybody know what i am doing wrong? or perhaps how another way to do it?

p.s ENCRYPT STRING is a random character string, not the actual word. Thanks, Matt


You may try this:

SELECT LOWER ( CONVERT ( DES_DECRYPT ( forename, 'ENCRYPT STRING' ) USING utf8 ) )
AS forename_decrypted FROM Users

The Lower-function can only convert strings, I don't know exactly if DES_DECRYPT returns a string or simply binary data..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜