[eluser]matt.asbury[/eluser]
Hi Todlerone
And TGIF indeed. I assume you have a field in the second table to contain the foreign key from the first table?
All you would need to do, as noctum suggested, is to insert the set of fields you need into the first table (I assume things like name) and then after you have inserted the record into the database, you set a variable for your new foreign key using the insert_id() function:
Code:
$foreign_key = $this->db->insert_id();
You can then start inserting a new record into the second (schedule) table setting the value of the field you are using to contain your foreign key to the created variable.