php - INSERT value from another table and variable -
i wondering if possible insert table (which have managed do) whilst inserting value of variable current php file?
i aiming user id table, have gotten selecting email user input. need insert hash automatically created via variable.
this current code gets correct id users table.
$forgot = $pdo->prepare("                         insert                           forgot (                               user_id                           ) select                               id                                                         users                                                         email = :email "); now need insert value of :hash too.
would need done separate query?
thanks.
try following:
insert forgot (     user_id, hash ) select     id, :hash     users     email = :email 
Comments
Post a Comment