im have 2 tables in my database all i want to do is taking the first table id and putting it in the second table 'type id' so i wrote $sql= "insert into 'first_table' (start_date,end_date) values ('".$startDate."','".$endDate."')"; * if i entered my start date as FEB 2 , end date as FEB 4 so what it does in this table for filling the start and end date properly but still i want to put the first table id into the typeid field so then i used $sql2="insert into first_table (typeid) SELECT ID FROM time"; and it retrieved the id from the other table but the problem is that it isn't showing the start and end dates so i wanna know how to make these 2 insert into and insert select statements as one statement so that when i try it , it inserts the data properly and thank you :)
Aucun commentaire:
Enregistrer un commentaire