I have an application that sends an email to the user to confirm their email when they register.
Then I have two tables in my internal database, being USUÁRIOS
and LOGIN
.
In the USUÁRIOS
table I have the field confirmed, which receives 0
or 1
:
0
if the user has not yet verified your email.
1
if the user has already confirmed his email.
In the LOGIN
table, I have the logged in field, which is the user who is logged in at the moment. Let's say he has already confirmed his email.
Therefore, I need to select the user that is logged in and update the field confirmed in the users table to 1
.
I did that, but that way it sounds like all the users have already confirmed their email:
update = "UPDATE usuarios SET confirmado = '1'";
db = getDataBase();
db.transaction (function (tx){
tx.executeSql (update);
});
In short, I want it to update only the user who is logged in, that is, logado=1
.
If anyone can help.