; $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]');
即使加引号也应该是双引号而不是单引号
嗯, 引号的问题,把引号去掉