|
|
|
ช่วยหน่อยคะเพิ่มเพิ่มแถวแล้วไม่บันทึกไม่ทราบว่าติดตรงไหน |
|
|
|
|
|
|
|
ตามหัวข้อเลยค่ะ เพิ่มแถวแล้วไม่บันทึกไม่ทราบว่าติดตรงไหน
Code (PHP)
<?
session_start();
include "../include/config.inc.php";
include "../include/function.inc.php";
if($action == "DamageManage"){
$Sq = "DELETE FROM caraccident WHERE JobID = '" + $JobID + "' ";
mysql_query($Sq);
$Sq = "OPTIMIZE TABLE caraccident";
mysql_query($Sq);
for($n = 0; $n < $NumDETAIL; $n++){
$s = "SELECT ID FROM caraccident ORDER BY ID DESC;";
$r = mysql_query($s);
$w = mysql_fetch_array($r);
$cID = $w['ID'] + 1;
//echo $n." / ".$NumDETAIL." - ".$DetailName[$n]."<br>";
if($DetailID[$n] != ""){
if($DetailLeft[$n] != "Y"){
$DetailLeft[$n] = "N";
}
if($DetailRight[$n] != "Y"){
$DetailRight[$n] = "N";
}
if($DetailL[$n] != "Y"){
$DetailL[$n] = "N";
}
if($DetailM[$n] != "Y"){
$DetailM[$n] = "N";
}
if($DetailN[$n] != "Y"){
$DetailN[$n] = "N";
}
if($DetailH[$n] != "Y"){
$DetailH[$n] = "N";
}
if($DetailO[$n] != "Y"){
$DetailO[$n] = "N";
}
if($DetailX[$n] != "Y"){
$DetailX[$n] = "N";
}
$Sq = "INSERT INTO caraccident (ID , JobID , DetailID , DetailName , DetailLeft , DetailRight , DetailL , DetailM , DetailN , DetailH , DetailO , DetailX) VALUES ('" + $cID + "' , '" + $JobID + "' , '" + $DetailID[$n] + "' , '" + $DetailName[$n] + "' , '" + $DetailLeft[$n] + "' , '" + $DetailRight[$n] + "' , '" + $DetailL[$n] + "' , '" + $DetailM[$n] + "' , '" + $DetailN[$n] + "' , '" + $DetailH[$n] + "' , '" + $DetailO[$n] + "' , '" + $DetailX[$n] + "');";
mysql_query($Sq);
//echo $Sq."<br>";
}
}
$Sq = "UPDATE joborder SET TotalAmount = '".$TotalAmount."' , Driver = '".$Driver."' , Age = '".$Age."' , Occupation = '".$Occupation."' ,
Relation = '".$Relation."' , Address = '".addslashes($Address)."' , Tel = '".$Tel."' , DrivingType = '".$DrivingType."' , DrivingLiense = '".$DrivingLiense."' ,
DrivingPlace = '".$DrivingPlace."' , DrivingStartDate = '".convertdate_YYYYMMDD($DrivingStartDate)."' ,
DrivingExprieDate = '".convertdate_YYYYMMDD($DrivingExprieDate)."' ,
Address2 = '".addslashes($Address2)."' , IdentityNumber = '".$IdentityNumber."' , IdentityPlace = '".$IdentityPlace."' ,
BrithDay = '".convertdate_YYYYMMDD($BrithDay)."' , CarriageBy = '".$CarriageBy."' , Cradle = '".$Cradle."' , Damage = '".$Damage."'
WHERE JobID = '".$JobID."' ";
mysql_query($Sq);
}
?>
Tag : PHP, HTML, JavaScript, Web (ASP.NET), Web Services
|
|
|
|
|
|
Date :
2017-12-25 10:56:54 |
By :
mewhappy |
View :
765 |
Reply :
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mysql_query($Sq); /// อยากดู Errors
Code (PHP)
/// อยากดู Errors
mysql_query($Sq);
mysql_query($Sq) or die("show Error :: $Sq ".mysql_error()); แทนที่
|
|
|
|
|
Date :
2017-12-25 11:23:44 |
By :
Hararock |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179865 ขอเดา คือ $cID หรือไม?
ถ้าใช่
แก้ Code SQL
เอา + ออกไป
แทน .
---------------------
เดา sql มันไม่รู้ +
|
|
|
|
|
Date :
2017-12-25 13:31:21 |
By :
Hararock |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ระบบคือ Insert หลายๆแถวลงระบบสิน่ะ
------------------------------------------
ไปอ่านดู Multiple Insert php ครับ
|
|
|
|
|
Date :
2017-12-25 14:25:08 |
By :
Hararock |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2017-12-25 17:23:20 |
By :
Hararock |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
php ต่อ string ใช้ จุด ครับ ไม่ใช้ บวก บวกใช้กับการ บวกเลข
Code (PHP)
$a = '12345' . 'กขคงจ';
echo $a;
$b='12345' + 'abcdef';
echo '<br>' , $b;
|
|
|
|
|
Date :
2017-12-29 16:58:40 |
By :
Chaidhanan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|