php - Inserting values to another table -
i have check if namesfroma tablea exist in namesfromb tableb using code.
select * tablea inner join tableb on(namefroma = namefromb)
and able output names exist. want store names exist in both table table named "existed" , column "name". should this.
simply use insert ... select
statement.
insert existed (existed.name) select a.name tablea inner join tableb on(namefroma = namefromb)
see official mysql documentation more details.
Comments
Post a Comment