|
|
|
คำสั่ง insert ผิดตรงไหนออ่ะ งง |
|
|
|
|
|
|
|
Code (PHP)
$dateorder = date("$e_date");
$dateime1 = $dateorder;
$date = explode('/', $dateime1);
$newdate = implode('-', array($date[2], $date[1], $date[0]));
for ($n=0;$n<count($sess_idproduct);$n++) {
$sql1= "insert into tb_order("pId,refid,pNum,pPrice,date,id_cus"," '$sess_idproduct[$n]','$randnum','$sess_num[$n]','$sess_price[$n]','$newdate','$usermem' ","tb_order")";
mysql_db_query($db,$sql1);
echo $sql1;
$sql_data = "update products set amount = amount-$sess_num[$n] where productscode = '$sess_idproduct[$n]'";
mysql_query($sql_data);
Tag : PHP
|
|
|
|
|
|
Date :
2011-09-20 13:51:05 |
By :
maysakikkok |
View :
813 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ผิดเยอะเลย
Syntax ที่ถูกต้อง
INSERT INTO table_name
VALUES (value1, value2, value3,...)
หรือไม่ก็
INSERT INTO table_name (column1, column2, column3,...)
VALUES (value1, value2, value3,...)
ที่เขียนมาไม่ตรงกับสักแบบเลยอ่ะ
|
ประวัติการแก้ไข 2011-09-20 14:07:16
|
|
|
|
Date :
2011-09-20 14:06:40 |
By :
adaaugusta |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ถ้ากลัวงง ก็ insert into set field = $field ไปเลยจะได้ไม่งง
|
|
|
|
|
Date :
2011-09-20 14:14:40 |
By :
Dragons_first |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|