|
|
|
สอบถามเรื่องการ Update ข้อมูลและมีการเพิ่มข้อมูลในหน้าแก้ไข |
|
|
|
|
|
|
|
ได้แล้วครับ
Code (PHP)
if(isset($_POST['submit']))
{
foreach($_POST['take_item'] as $key => $value){
$take_item = $value;
$list = $_POST['list'][$key];
$number = $_POST['number'][$key];
$unit = $_POST['unit'][$key];
$date = $_POST['date'][$key];
$note = $_POST['note'][$key];
for ($i=0; $i < sizeof($list); $i++) {
if(!empty($list[$i]))
{
if(!empty($take_item)){
$result = query("UPDATE `takeout_item` SET `take_itemname` = '$list', `take_item_number` = '$number', `take_item_unit` = '$unit', `take_item_date` = '$date',
`take_note` = '$note' WHERE `take_item` = '$take_item'");
}else{
$result = query("INSERT INTO `takeout_item` SET `take_itemname` = '$list', `take_item_number` = '$number', `take_item_unit` = '$unit', `take_item_date` = '$date',
`take_note` = '$note', `takeinout_id` = '$takeid'");
}
}
}
}
}
|
ประวัติการแก้ไข 2022-02-18 13:00:56
|
|
|
|
Date :
2022-02-18 13:00:32 |
By :
benlovehi5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|