I'm trying convert passwords from a database that weren't originally SHA1 encrypted, so I'm trying to do a simple update however the update isn't successful. After echoing the results of the sql query and pasting it into PHPMyAdmin to see if there are any errors, I appear to have an error in my syntax.
Maybe I just need some fresh eyes onto this.
PHP:
sql = "UPDATE employee SET (First_name='$oldfname', Surname='$oldsname', Email='$oldemail', Password='" . SHA1($oldpword) . "', Type='$oldtype') WHERE EmpID = $oldempid";
Outputted SQL:
UPDATE employee SET (First_name='John', Surname='Doe', Email='jdoe@gmail.com', Password='a0367e1caffa9e4b5d08f9e83a5e63fea9d3978e', Type='Manager') WHERE EmpID = 1
PHPMyAdmin response:
"#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(First_name='John', Surname='Doe', Email='jdoe@gmail.com', Password='a0' at line 1"
Thanks,
Jezzabeanz

New Topic/Question
Reply



MultiQuote



|