Mini Shell
<?php
include '../db/database.php';
$lahistoryID = $_POST['lahistoryID'];
$year = $_POST['year'];
$lasick = $_POST['lasick'];
$laerrand = $_POST['laerrand'];
$lamaternity = $_POST['lamaternity'];
$sql = "UPDATE `la_history` SET `year`='$year', `lasick`='$lasick', `laerrand`='$laerrand', `lamaternity`='$lamaternity' where `lahistoryID`='$lahistoryID'";
$result = mysqli_query($link, $sql);
if($result){
header('Content-Type: application/json');
echo json_encode(array('status' => 'success','message' => 'บันทึกข้อมูลเรียบร้อยแล้ว'));
} else {
header('Content-Type: application/json');
$errors = "เกิดข้อผิดพลาดในการบันทึกรหัสอาจจะซ้ำกัน กรุณาลองใหม่ ";
echo json_encode(array('status' => 'danger','message' => $errors));
}
Zerion Mini Shell 1.0