I've got a little question about updating MySQl tables in a database.
I have one table called phplist_user_user that contains a column called id and one called email.
In the same database I have another table called phplist_listuser in which there is a column called userid and one called listid.
What I would like to do is update the value of phplist_listuser.listid where phplist_listuser.userid is equal to the value of phplist_user_user.id of a the row of a certain phplist_user_user.email.
In other words I only have the value contained in phplist_user_user.email to build my query and based on that I have to update the value phplist_listuser.listid of the user with that specific email address, who also has phplist_user_user.id and phplist_listuser.userid
I am not too familiar with MySQL.
Here is my attempt at the query syntax, I was hoping someone can point out what I did wrong:
$query = "UPDATE phplist_listuser SET phplist_listuser.listid = '2' WHERE phplist_listuser.userid = phplist_user_user.id && phplist_user_user.id = phplist_user_user.email LIMIT 1";
It is obviously wrong because phplist_user_user.id will never be equal to phplist_user_user.email but I didn't know how to link them.