Each step gathers data from user input. This is public function from step1. Im trying to insert the data to the database but im getting mostly clientID error.
public function submitApplication($clientID, $managingHead, $managingHeadMobNum, $managingHeadTelNum, $natureBusiness, $psicNum, $psicDesc, $dateEstablishment, $numEmployees, $pcoName, $pcoMobNum, $pcoTelNum, $pcoEmail, $pcoAccredNo, $pcoAccredDate, $region, $province, $city, $barangay, $zipCode, $latitude, $longitude){
global $conn;
$query = "INSERT INTO application(clientID, appRegistration, appManager, appManagerContactNumber, appManagerTelephoneNumber,
appNatureBusiness, appPSICNum, appPSICDesc, appDateClient, appNumEmployees,
appPCOName, appPCOMobileNumber, appPCOTelephoneNumber, appPCOEmail, appPCOAccredNo,
appPCODateAccred, appFaciRegion, appFaciProvince, appFaciCity, appFaciBarangay,
appFaciZip, appGeoLatitude, appGeoLongitude, appStatus)
VALUES (?, CURDATE(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'PROCESSING')";
$stmt = $conn->prepare($query);
$stmt->bind_param('ssssssssssssssssssssss', $clientID, $managingHead, $managingHeadMobNum, $managingHeadTelNum,
$natureBusiness, $psicNum, $psicDesc, $dateEstablishment, $numEmployees, $pcoName, $pcoMobNum,
$pcoTelNum, $pcoEmail, $pcoAccredNo, $pcoAccredDate, $region, $province, $city, $barangay,
$zipCode, $latitude, $longitude);
if ($stmt->execute()){
return true;
} else{
return false;
}
$stmt->close();
}
Is there a way to insert submitapplication2 in the same public function?
public function submitApplication2($ecpID, $clientID, $permitType, $permitNumber, $dateIssued, $expiryDate, $placeIssuance, $permitFile) {
global $conn;
$query = "INSERT INTO ecp(ecpID, clientID, ecpPermitType, ecpPermitNo, ecpPermitDateIssued, ecpPermitExpiry, ecpPlaceInsurance, ecpPermitFIle)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
$stmt = $conn->prepare($query);
$stmt->bind_param('ssssssss', $ecpID, $clientID, $permitType, $permitNumber, $dateIssued, $expiryDate, $placeIssuance, $permitFile);
if ($stmt->execute()) {
return true;
} else {
return false;
}
$stmt->close();
}
}
8