I am recieving this mysql error:
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 ‘@password)’ at line 1
This is for the sql below:
Update Teacher
SET TeacherSalt=@salt, TeacherPassword=SHA1(TeacherSalt @password)
What do I need to change so this sql could work?
UPDATE:
Need helping salting the PAssword. If the TeacherPassword and TeacherSalt columns look like this:
TeacherPassword TeacherSalt
cricket01
sachin01
priggy02
Then after I do this statement:
Update Teacher
SET TeacherSalt = @salt,
TeacherPassword = SHA1(CONCAT(@password,@salt))
Then the TeacherPassword and TeacherSalt columns both provide blank rows. How can I successfully salt the passwords?
Isn’t it like this? (remove the column
TeacherSaltin theSHA1)SQLFiddle Example