|
|
|
รบกวนสอบถามการใช้ if isset หลายครั้งหน่อยจ้าาาา มือใหม่ php |
|
|
|
|
|
|
|
Code (PHP)
if (isset($_REQUEST['action']) && $_REQUEST['action'] == "SCAN") {
if (isset($_POST['chk_machine']) && (isset($_POST['chk_time']) && (isset($_POST['barcode']) && $_POST['barcode']!==null))) {
$sqlupdate ="update mdt_label set label_stamp=now(),label_in=now(),label_inby='".$_SESSION['login_user']."',
label_machine=".$_POST['chk_machine'].",label_time=".$_POST['chk_time'].",label_status='3'
where label_code='".$_POST['barcode']."'";
if (isset($_POST['chk_machine']='0') && (isset($_POST['chk_time']) && (isset($_POST['barcode']) && $_POST['barcode']!==null))) {
$sqlupdate ="update mdt_label set label_stamp=now(),label_in=now(),label_inby='".$_SESSION['login_user']."',
label_time=".$_POST['chk_time'].",label_status='3'
where label_code='".$_POST['barcode']."'";
mysqli_query($db,$sqlupdate);
}
}
ERROR:
[26-Nov-2018 09:58:51 UTC] PHP Fatal error: Cannot use isset() on the result of an expression (you can use "null !== expression" instead)
Tag : PHP, CakePHP, FuelPHP
|
|
|
|
|
|
Date :
2018-11-26 17:19:36 |
By :
YongT |
View :
1022 |
Reply :
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
คือต้องการเช็คว่า isset($_POST['chk_machine']='0') แล้วให้มันไม่ต้อง update fild นี้อะคะ
|
|
|
|
|
Date :
2018-11-26 17:59:23 |
By :
YongT |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|