[eluser]NetChaos[/eluser]
In a website I’m developing, for user registration I have two tables, “users” table and “users_info” table with the following sample fields.
Quote:"users" table -> "id (primary key, auto increment), username, password, created_on" etc
Quote:"users_info" table -> "id (primary key, auto increment), users_id, first_name, last_name, billing address, shipping address" etc.
The "users_id" field in the "users_info" table is to set relationship between the tables. (Database engine is MYISAM not INNODB)
Using this I know how to select, update and delete the records from both table but wondering how to insert a new record to both tables simultaneously using active records or otherwise.
In the user guide I saw the "$this->db->insert_id()" function. Will it be a fool proof method to get the "id" using "$this->db->insert_id()", after inserting to the "users" table and use it as the "users_id" while inserting into the "users_info" table ?
Thank You