Reputation: 12040
PHP's md5("123123") gives me a correct value of 4297f44b13955235245b2497399d7a93, while mysql's
select md5("123123");
gives me '6e9abeea535938c496a261b3b39c0d79'.
Why would this happen ? does this have anything to do with mysql server incoding? I kinda lost it, help much appreciated!
Thank you!
Upvotes: 1
Views: 4112
Reputation: 8356
6e9abeea535938c496a261b3b39c0d79
is the value of md5("132123")
,so I think you have a type mistake.
Upvotes: 17
Reputation: 76736
I get the same value from mysql and php. Might have something to do with multi-byte characters?
mysql> select md5("123123");
+----------------------------------+
| md5("123123") |
+----------------------------------+
| 4297f44b13955235245b2497399d7a93 |
+----------------------------------+
1 row in set (0.00 sec)
php > echo md5("123123");
4297f44b13955235245b2497399d7a93
Upvotes: 1