I have these two tables('users','users2') I want to insert data in my two tables. What would be the best approach? using array?
My Model code is :
function user_add($option){ $this->db->set('userid',$option['user_id']); $this->db->set('email', $option['email']); $this->db->set('password', $option['pw']); $this->db->set('created', 'NOW()', false); $this->db->insert('users'); //users2 tables $this->db->set('user_id',$option['user_id']); $this->db->insert('users2'); }