|
 |
|
เหมือนเวปมันแจ้งเตือนว่ายังไม่ประกาศตัวแปรอะครับ Notice: Undefined variable: |
|
 |
|
|
 |
 |
|
หลังจากเปิด error เป็น E all มันเหมือนแจ้งเตือนว่า $order++; มันยังไม่ได้ประกาศตัวแปร จะแก้ไขอย่างไรดีครับ
เอาแบบไม่ปิด warning
$ebits = ini_get('error_reporting');
error_reporting($ebits ^ E_NOTICE);
แล้วก็แก้ ใน php.ini ก็ไม่แก้อะครับจะกำหนดค่า $order อย่างไรดี
Code (PHP)
foreach($_REQUEST['empCountSingle'] as $key => $value){
if($key==0)
{$status = "on";
}else{
$status = "off";}
$authorizer = explode("6", $value);
for($i=0;$i<count($authorizer);$i++){
$order++;
$strSQL = "INSERT INTO assigner_officer (absence_no,assigner,employee_id,copy,approve,pass,assigndate,status,step)VALUES
('".$doc_no."','".$employee_id."','".$authorizer[$i]."','','','','','".$status."','".$order."') ";
$sqlquery=mysql_query($strSQL);
}
}
Tag : PHP, MySQL

|
ประวัติการแก้ไข 2012-05-22 22:01:43 2012-05-22 22:02:31
|
 |
 |
 |
 |
Date :
2012-05-22 22:00:06 |
By :
phongphisut |
View :
1122 |
Reply :
6 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แล้วตัวแปร $order มันเริ่มมาจากบรรทัดไหนล่ะ
|
 |
 |
 |
 |
Date :
2012-05-22 23:28:35 |
By :
sakuraei |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ก็ประกาศตัวแปร
$order=0;
ไว้บนลูป
|
 |
 |
 |
 |
Date :
2012-05-23 08:21:44 |
By :
rootElement@kmutnb |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|