[eluser]rochellecanale[/eluser]
here's my simple task:
1. I just want to add a new membership
2. The registration includes membership member table(memberid, lastname,firstname,etc...) and my other table will be authentication table(authid, fkmemberid, username, password)
how can i add values to two tables in one function/method?
i try restring the functions in one functions.
ex:
Code:
function insertalldata(){
$this->insertmemdata();
$this->insertmemauth();
}
function insertmemdata(){
$data = array(
'memberid'=> null,
'lastname' => $this->input->post('lastname'),
.
.
.
);
return $this->db->insert('tbl_member',$data);
}
function insertmemauth(){
$data = array(
'authid'=> null,
'fkmemberid' => null,
'username' => $this->input->post('username'),
.
.
.
);
return $this->db->insert('tbl_auth_member',$data);
}
how can i run mutiple queries in one function?