function registerByStateAndPhone($mobile, $state, $staffID) { $dbObj = new InteractDatabase(); $acc = new UserAccounts(); // Check Already PhoneNumber exist or not $result = $acc->checkPhoneExist($mobile); if ($result == 'NotExist') { $isql = "INSERT INTO `userregistration`(`mobile`, `state`, `staffID`) VALUES ('" . $mobile . "','" . $state . "', '" . $staffID . "')"; $dbObj->addupdateData($isql); } $ssql = "SELECT idUserRegistration FROM `userregistration` WHERE mobile='" . $mobile . "';"; $json = $dbObj->getJSONData($ssql); $dejson = json_decode($json); $regId = $dejson[0]->{'idUserRegistration'}; return $regId; }