|
 |
|
ช่วยดูให้หน่อยครับ ในตาราง Informdetail มันไม่เข้าฐานข้อมูลครับ ไม่ทราบว่าผิดที่ SQL รึป่าว ดูให้หน่อยนะครับ |
|
 |
|
|
 |
 |
|
Code (PHP)
<?php
session_start();
mysql_connect("localhost","root","root");
mysql_select_db("laundry");
mysql_query("SET NAMES tis620");
/* $objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery); */
//function AddOrderDetail($strSQL){
$List = $_SESSION["Column1"][$i];
$Qty = $_SESSION["Column2"][$i];
$DetailType = $_SESSION["Column3"][$i];
$Blam = $_SESSION["Column4"][$i];
$Price = $_SESSION["Column7"][$i];
$PriceTotal = $_SESSION["Column8"][$i];
$continentList = $_SESSION["Column9"][$i];
$DateInform = date('Y-m-d');
$DateReceive = date('Y-m-d',strtotime("+2 day"));
$Priority = $_SESSION['Priority'];
// }
for($i=0;$i<count($_SESSION["Column1"]); $i ++)
{
$insert1 = "INSERT inform (Inform_ID,Cus_ID,DateInform,DateReceive,Status, Priority,Cancel) VALUES ('', '', '".$DateInform."', '".$DateReceive."','".รอดำเนินการ."','".$_SESSION['Priority']."','')";
$result1 = mysql_query($insert1);
$id = mysql_insert_id(mysql_connect("localhost","root","root"));
$insert3 = "INSERT informdetail (InformDetail_ID, Inform_ID, ServiceID, Detail, Price, Qty, PriceTotal, TypesLaundry, Blame) VALUES ('','".$id."','".$_SESSION["Column9"][$i]."','".$_SESSION["Column1"][$i]."','".$_SESSION["Column7"][$i]."','".$_SESSION["Column2"][$i]."','".$_SESSION["Column8"][$i]."','".$_SESSION["Column3"][$i]."','".$_SESSION["Column4"][$i]."')";
$result3 = mysql_query($insert3);
}
if($result3){
echo "ไม่สามารถเพิ่มข้อมูลได้"; echo $insert3;
}
else {
echo "เพิ่มข้อมูลเรียบร้อยแล้ว"; echo $insert3;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>บันทึกใบแจ้งซักรีด</title>
</head>
<body>
</body>
</html>
Tag : PHP

|
|
 |
 |
 |
 |
Date :
2012-03-10 00:50:20 |
By :
Dongonline |
View :
914 |
Reply :
5 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตาราง Inform เข้าฐานข้อมูลแล้วครับ
|
 |
 |
 |
 |
Date :
2012-03-10 08:14:44 |
By :
Dongonline |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แต่ตาราง InformDetail ยังไม่เข้าฐานข้อมูลครับ
|
 |
 |
 |
 |
Date :
2012-03-10 08:15:12 |
By :
Dongonline |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมใส่แล้วครับ แต่มันยังขึ้น
ไม่สามารถเพิ่มข้อมูลได้INSERT informdetail (InformDetail_ID, Inform_ID, ServiceID, Detail, Price, Qty, PriceTotal, TypesLaundry, Blame) VALUES ('','0','001_1','ซักเสื้อเชิ๊ดแขนสั้น','10','4','40','ซักอย่างเดียว','')
|
 |
 |
 |
 |
Date :
2012-03-10 09:51:01 |
By :
Dongonline |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ทำได้แล้วครับ ขอบคุณครับ
|
 |
 |
 |
 |
Date :
2012-03-10 18:25:30 |
By :
Dongonline |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|