开发者

mysql md5(md5('pass') + salt) not equal php md5(md5('pass').salt)

开发者 https://www.devze.com 2023-03-04 20:38 出处:网络
MySql query: select md5(md5(\'pass\') + \'123\'开发者_如何学C) from foo gives c8ffe9a587b126f152ed3d89a146b445

MySql query:

select md5(md5('pass') + '123'开发者_如何学C) from foo

gives c8ffe9a587b126f152ed3d89a146b445

while php md5(md5('pass').'123')

gives ae2553fb5786e36233d25c879faf3863

What is wrong?


select md5(CONCAT(md5('pass'), '123'))

+ is probably adding it.


That's not how you concatenate strings in MySQL. See for yourself: SELECT 'pass' + '123';

Instead try SELECT md5(concat(md5('pass'), '123')) from foo

0

精彩评论

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