您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

SQL密码MD5加密问题

2024/4/7 7:44:51发布9次查看
$sql=select stu_id,stu_password from studentpwd2;$res=sqlsrv_query($conn,$sql);while($r=sqlsrv_fetch_array($res)){ $b=md5('$r[1]'); echo $r[1].对应md5.$b.
; $sql2=update studentpwd2 set stu_password='.$b.' where stu_id='.$r[0].'; echo $sql2.
; sqlsrv_query($conn,$sql2);}
我想把之前的密码都变成md5加密的,然后就这样子,为什么密码都变成一样的了
123456对应md5ab71f115b2cd70037a03031f9827b924
update studentpwd2 set stu_password='ab71f115b2cd70037a03031f9827b924' where stu_id='id1'
111111对应md5ab71f115b2cd70037a03031f9827b924
update studentpwd2 set stu_password='ab71f115b2cd70037a03031f9827b924' where stu_id='id2'
回复讨论(解决方案) $b=md5('$r[1]');
这里。。。。应该把引号去掉。。。最后结果是‘$r[1]'这7个字符的md5。。。。
$b=md5('$r[1]');
即使加引号也应该是双引号而不是单引号
嗯, 引号的问题,把引号去掉
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product