To change the value of more than one column, use a comma delimiter between the column assignments, like this:
UPDATE mytab SET col1 = val , col2 = val WHERE ...
^
+----- comma here
Your query is valid syntax, and it's executing successfully.
But your query is of the form:
UPDATE users SET auth = (expression) WHERE username='$_GET[username]'
The problem is that query has an AND
keyword where you want a comma delimiter.
What's happening is MySQL is reading that AND
as part of the expression being assigned to the column auth
. MySQL is evaluating this expression:
'yes' AND authtime='$time'
MySQL is evaluating that as a boolean expression, and taking the result of the boolean expression (which is FALSE), and assigning that result to column auth
. (And that's the only column your statement is assigning a value to.)