Stuck on PHP query

前端 未结 2 1155
梦毁少年i
梦毁少年i 2021-01-28 11:40

I\'ve created a page that allows users to change their password and email. All of it works but for some reason when I just want to change my email I also get the field Curre

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-28 12:33

    Your query is probably spitting out an array. Try doing print_r($row) and examining the output. I have a feeling you're getting an associative array here and need to access the old password differently. Put the print_r after this line:

    $row = mysql_fetch_assoc($queryget);
    

    The answer is probably $row[0]['password'];

    Also, don't use MD5 for hashing, use Scrypt or something like that with salt and maybe pepper.

提交回复
热议问题