Reputation: 323
MySql query:
select md5(md5('pass') + '123') from foo
gives c8ffe9a587b126f152ed3d89a146b445
while php md5(md5('pass').'123')
gives
ae2553fb5786e36233d25c879faf3863
What is wrong?
Upvotes: 2
Views: 4133
Reputation: 18338
select md5(CONCAT(md5('pass'), '123'))
+
is probably adding it.
Upvotes: 11
Reputation: 5620
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
Upvotes: 4