My mysql query is not updating my database correctly can some one help me fix this problem I think it has something to do with the JOIN.
Here is my mysql query.
"UPDATE users
SET users.last_login = NOW()
FROM users JOIN info ON info.user_id = users.user_id
WHERE (info.email = '" . $e . "' OR users.username = '" . $e . "')
AND users.password = '" . $sha512 . "'
AND users.active IS NULL"
Here is the working query before I used the JOIN.
"UPDATE users SET last_login = NOW() WHERE (email = '" . $e . "' OR username = '" . $e . "') AND password = '" . $sha512 . "' AND active IS NULL"
Your query syntax is wrong. The syntax for cross-table update in MySQL is somewhat
different than T-SQL. It should be as below.
Check the below link –
http://blog.ookamikun.com/2008/03/mysql-update-with-join.html