I load the form, and I don't get any mysqli_stmt_close()
error on the form file. When I submit data from the form to database, I get mysqli_stmt_close()
error. See below the code from the INSERT STATEMENT.
$sql = "INSERT INTO manpower, payments (grade_level, number_of_staff, year, consolidated_salary, perculiar_allowance, conpss_salaries) VALUES (?, ?, ?, ?, ?, ?)";
if($stmt = mysqli_prepare($link, $sql)){
var_dump($stmt);
// Bind variables to the prepared statement as parameters
mysqli_stmt_bind_param($stmt, 'ssssss' ,$param_grade_level, $param_number_of_staff, $param_year, $param_consolidated_salary,
$param_perculiar_allowance, $param_conpss_salaries);
// Attempt to execute the prepared statement
if(mysqli_stmt_execute($stmt)){
// Records created successfully. Redirect to landing page
header("location: grid1.php");
exit();
} else{
echo "Something went wrong. Please try again later.";
}
}
// Close statement
mysqli_stmt_close($stmt);
}