rajchahal Posted July 25, 2008 Share Posted July 25, 2008 hi there I have a whats on section, table 1 holds event info, name, location etc The 2nd table holds occurances of events, these are date pairs, publish-date and unpublish-date. On the admin page I would need to to insert items into table 1 and items into table2, but with table 2 I may have more than one occurance (record) to add. As I could have 2 sets of dates an event occurs on. I need only ONE button that would update both tables. Also, to make this a bit user friendly, with table 2 I would like to have a + / - buttons So I can either add another date pair or remove a date pair. Could someone explain how i can do this.. Code would be great ! Thanks Link to comment https://forums.phpfreaks.com/topic/116588-inserting-into-2-tables-table-2-with-multiple-records/ Share on other sites More sharing options...
Jabop Posted July 25, 2008 Share Posted July 25, 2008 Just relate your second table, even_occurrences, to your event_info table. event_info ID | EventInfo | Location 1 Event!11 Your backyard event_occurrences ID | EventID | PublishDate | UnpublishDate 1 1 Date1 asdf 2 1 Date2 asdf Link to comment https://forums.phpfreaks.com/topic/116588-inserting-into-2-tables-table-2-with-multiple-records/#findComment-599493 Share on other sites More sharing options...
rajchahal Posted July 25, 2008 Author Share Posted July 25, 2008 Thanks for your reply My tables are already related, table 2 uses a foreign key that matches table1. But this is not what I meant, I want to have a page with data from two taples displayed on it, then I can update the fields, finally I want to press a single button to update both tables. The added complication is that I would like to add more than 1 occurance to table2. See attached image pls [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/116588-inserting-into-2-tables-table-2-with-multiple-records/#findComment-599548 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.