i am trying to insert to multiple table using single registration form in android. and want it to insert same id's to both tables but it's taking different id's, can someone tell me what should i do for this?
DbOperations.php
public function createUser($name, $surname, $username, $user_pass, $address, $pin, $mail, $phone, $a, $b, $c, $d){
if($this->isUserExist($username,$mail,$phone)){
return 0;
}else{
$password = md5($user_pass);
$stmt = $this->con->prepare("INSERT INTO `user_data` (`name`, `surname`, `username`, `password`, `address`, `pin`, `mail`, `phone`) VALUES (?, ?, ?, ?, ?, ?, ?, ?);");
$stmt->bind_Param("ssssssss",$name,$surname,$username,$password,$address,$pin,$mail,$phone);
if(!$stmt->execute()){
return 2;
}
$stmtcate = $this->con->prepare("INSERT INTO `employee_category` (`name`, `pin`, `a`, `b`, `c`, `d`) VALUES (?, ?, ?, ?, ?, ?);");
$stmtcate->bind_Param("ssssss",$name,$pin,$a,$b,$c,$d);
if ($stmtcate->execute()){
return 1;
}else{
return 2;
}
}
}