PHP md5()提供的输出与MySQL md5不同 [英] PHP md5() gives different output then MySQL md5
本文介绍了PHP md5()提供的输出与MySQL md5不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试建立一个登录系统,但是我无法解决一个问题: PHP通过md5()给了我另一个输出;比MySQL ...
I'm trying to set up a login system, but I can't solve one problem: PHP is giving me an other output with md5(); than MySQL...
例如,在PHP中:
$password = md5("brickmasterj");
return $password;
返回:
3aa7b18f304e2e2a088cfd197351cfa8
但是MySQL的等效版本给了我一个较短的版本:
But the MySQL equivalent gives me a shorter version:
3aa7b18f304e2e2a08
出什么问题了?以及在检查密码时该如何使用?
What's the problem? And how do I work with this while checking passwords?
推荐答案
我猜您的表的列长度有问题,请将密码字段的长度至少设置为32
I guess the problem in the length of column of your table, set the length of password field to at least 32
这篇关于PHP md5()提供的输出与MySQL md5不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文