我在这个问题上待了太久了。我似乎无法找出问题所在。添加和删除表单运行正常。当涉及更新时,它总是显示错误。请帮忙!
<?php require_once 'database_connect/mysql_connect.php'; ?>
<?php
$ID = $_POST['ID'];
$FirstName = $_POST['FirstName'];
$MiddleName = $_POST['MiddleName'];
$LastName = $_POST['LastName'];
$Age = $_POST['Age'];
$Course = $_POST['Course'];
$Year = $_POST['Year'];
$Gender = $_POST['Gender'];
$Phone = $_POST['Phone'];
$HomeCell = $_POST['HomeCell'];**strong text**
$Occupation = $_POST['Occupation'];
$CivilStatus = $_POST['CivilStatus'];
$Address = $_POST['Address'];
$Father = $_POST['Father'];
$Mother = $_POST['Mother'];
$Bloodtype = $_POST['Bloodtype'];
$Weight = $_POST['Weight'];
$Height = $_POST['Height'];
$birthdate = $_POST['birthdate'];
$query = "UPDATE tbl_clinic
SET `tbl_clinicFname` = '$FirstName',
`tbl_clinicMname` = '$MiddleName',
`tbl_clinicLname` = '$LastName',
`tbl_clinicAge` = '$Age'
`tbl_clinicCourse` = '$Course',
`tbl_clinicYear` = '$Year',
`tbl_clinicGender` = '$Gender',
`tbl_clinicPhone` = '$Phone',
`tbl_clinicHomeCell` = '$HomeCell',
`tbl_clinicOccupation` = '$Occupation',
`tbl_clinicCivilStatus` = '$CivilStatus',
`tbl_clinicAddress` = '$Address',
`tbl_clinicFather` = '$Father',
`tbl_clinicMother` = '$Mother',
`tbl_clinicBloodtype` = '$Bloodtype',
`tbl_clinicWeight` = '$Weight',
`tbl_clinicHeight` = '$Height',
`tbl_birthdate` = '$birthdate'
WHERE `tbl_clinicID` = '$ID'";
if (mysqli_query($conn, $query))
{
echo "<h1><center> Updated Successfully! </center> </h1>";
} else {
echo "Error Updating Data: " ;
}
?>