I am trying to update the email in multiple tables for when a user wants to change his current email. The problem is how to update the email for tables that the user has no connection with yet. If a new user tries to change his email adress he will only have a connection with 2 of 4 tables so his email doesn't exist in the other 2.
So my question is if there is someway here for me to update the email in all tables that has the email inside it and skip the one without any trace of it inside.
My current attempt is to do this, but the issue here is that this user doesn't have a connection with the tables posts and votes yet.
$update_email = $pdo->prepare("UPDATE users, votes, user_biography, posts SET
email = :email_new WHERE email=:email");
$update_email->bindParam(':email_new', $new_email);
$update_email->bindParam(':email', $email);
$update_result_email = $update_email->execute();