postbil.com Posted November 15, 2009 Share Posted November 15, 2009 Hello Phpfreaks. I have created a function in a PHP script the user is able to change password but I get always a coward when I try to run the script. I use the function PASSWORD () to encrypt the user password .. Here's the error I keep getting .. Fatal error: Call to undefined function password () Here is my MYSQL code ... $ db = mysql_connect ( 'localhost', 'root','') or die (error. '); mysql_select_db ( 'postbil', $ db) or die (mysql_error ($ db)); $ query = 'UPDATE site_user SET password = " '. mysql_real_escape_string (PASSWORD ($ password), $ db).'" WHERE email = " '. mysql_real_escape_string ($ _SESSION [' loginname '], $ db).'" '; mysql_query ($ query, $ db) or die (mysql_error ()); mysql_close ($ db); I very much hope there is someone who can help me .. What am I doing wrong? In advance thank you very much! Quote Link to comment https://forums.phpfreaks.com/topic/181600-update-password/ Share on other sites More sharing options...
Mchl Posted November 15, 2009 Share Posted November 15, 2009 PASSWORD() is MySQL's function not PHP. And you shouldn't really use it. Hash passwords with md5 or hash Quote Link to comment https://forums.phpfreaks.com/topic/181600-update-password/#findComment-957894 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.