I´m trying to insert data into diferent tabels with php, but dosent get it to work.
Heres my db structure: 1
Table: event
Structure: FromDate | ToDate | locationID
Heres my db structure: 2
Table: jointable
Structure: EventID | locationID
The thing i want to do more specific, i have inputs for “Fromdate” and “todate” and “locationid”. I want to input fromdate and todate into table1, and locaionid to table2
Here is my sql query:
mysql_query("INSERT INTO event (FromDate, ToDate, locationID)
VALUES ('$_POST[startdate]','$_POST[enddate]','$_POST[locationID)");
Any idea how i can “sort out” locationID to input it on my jointable instead?
Excuse for my bad enlish, i hope you understand what im trying to do.
Try this:
Call another query for inserting into other table: