|
 |
|
ไม่สามารถ insert ลง table ได้ ครับ จะออกตรง else "Error input try again!! ตลอด ไม่ทราบว่าผิดตรงไหนครับ |
|
 |
|
|
 |
 |
|
.
.
.
$sql = "INSERT INTO $custb_test ";
$sql .= "(scope_test,test_id,test_name,test_type,test_type_other,sample_type,sample_no,sample_quan,sample_storage,want_th_rpt,want_en_rpt,get_rpt,
name_send_sample,name_get_sample,date_get_sample,about_test,approval,tm_name,file_att,date_result,change1,change2,change3
,cost_test_get,cost_no_because,cost_test,cost_other,cost_discount,cost_total,pay_type,pay_total,bill_no1,bill_no2,name_get_cost2,
date_pay_cost,name_get_rpt,date_to_get_rpt,test_status)";
$sql .="VALUES ";
$sql .="('".$_POST["scope_test"]."','".$_POST["test_id"]."','".$_POST["test_name"]."' ";
$sql .=",'".$_POST["test_type"]."','".$_POST["test_type_other"]."','".$_POST["sample_type"]."' ";
$sql .=",'".$_POST["sample_no"]."','".$_POST["sample_quan"]."','".$_POST["sample_storage"]."' ";
$sql .=",'".$_POST["want_th_rpt"]."','".$_POST["want_en_rpt"]."','".$_POST["get_rpt"]."' ";
$sql .=",'".$_POST["name_send_sample"]."','".$_POST["name_get_sanple"]."','".$_POST["date_get_sample"]."' ";
$sql .=",'".$_POST["about_test"]."','".$_POST["approval"]."','".$_POST["tm_name"]."' ";
$sql .=",'".$_POST["file_att"]."','".$_POST["date_result"]."','".$_POST["change1"]."' ";
$sql .=",'".$_POST["change2"]."','".$_POST["change3"]."','".$_POST["cost_test_get"]."' ";
$sql .=",'".$_POST["cost_no_because"]."','".$_POST["cost_test"]."','".$_POST["cost_other"]."' ";
$sql .=",'".$_POST["cost_discount"]."','".$_POST["cost_total"]."','".$_POST["pay_type"]."' ";
$sql .=",'".$_POST["pay_total"]."','".$_POST["bill_no1"]."','".$_POST["bill_no2"]."' ";
$sql .=",'".$_POST["name_get_cost2"]."','".$_POST["date_pay_cost"]."','".$_POST["name_get_rpt"]."' ";
$sql .=",'".$_POST["date_to_get_rpt"]."','".กำลังดำเนินการ."') ";
//-----------//
$result = mysql_query($sql);
if($result)
{
mysql_affected_rows();
echo "---->บันทึกข้อมูลเรียบร้อย <br />";
echo $_POST["scope_test"] ;
}
else
echo "Error input try again!!";
จะออกตรง else
"Error input try again!!
ตลอด
ไม่ทราบว่าผิดตรงไหนครับ
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2010-02-15 16:09:52 |
By :
kung1451 |
View :
787 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลอง echo ค่า $sql ออกมาดูดิคะ เพื่อดูว่าตัวแปรมาครบป่าว
|
 |
 |
 |
 |
Date :
2010-02-15 16:28:06 |
By :
jaejai |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
echo ค่าแล้วลอง Copy ไป query ใน phpmyadmin ดูครับ 
|
 |
 |
 |
 |
Date :
2010-02-15 16:59:25 |
By :
onizike |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|