I included a bootstrap modal in the code to update member's data. The modal is populating data from the table. However, when I change some data in the bootstrap modal and click the "Update" button, it is not updating data. The modal just close it. Here are the screenshot and the code.
Edit Button Code
<a href="activemembers?viewId=<?php echo $id; ?>" type="button" class="btn btn-info"
data-toggle="modal" data-target="#myModals">
<i class="fas fa-eye" title="View Member Details"></i>
</a>
<a href="" type="button" class="btn btn-primary" data-toggle="modal"
data-target="#myModal<?php echo $id; ?>">
<i class="fas fa-edit" title="Edit Member Data"></i>
</a>
<div class="modal" id="myModal<?php echo $id;?>">
if(isset($_POST['update'])){
$fname1=$_POST['fname'];
$lname1=$_POST['lname'];
$email1=$_POST['email'];
$mnumber1=$_POST['mnumber'];
$agencytype1=$_POST['agencytype'];
$memtype1=$_POST['memtype'];
$memstatus1=$_POST['memstatus'];
$agency1=$_POST['agency'];
$jobtitle1=$_POST['jobtitle'];
$update="UPDATE member
SET fname='$fname1',lname='$lname1',
email='$email1',mnumber='$mnumber1',
agencytypecode='$agencytype1',
memtypecode='$memtype1',
memstatuscode='$memstatus11',
agency='$agency1',jobtitle='$jobtitle1',
updatedate=Now()
WHERE id='$edit_id'";
$result12=mysqli_query($dbc,$update);
if($result12){
header('Location: activemembers.php');
exit();
} else {
die("Update Member Error".mysqli_error($dbc));
}
}
?>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…