 |
มีปัญหาในการ Insert ข้อมูลลง MS SQL ค่ะ Query failed in C:\AppServ\www\Admin\AddEmp1_Save.php on line 9 ต้องแก้ตรงไหนเหรอคะ |
|
 |
|
|
 |
 |
|
Code (PHP)
<?
$objConnect = mssql_connect(".","sa","") or die("Error Connect to Database");
$objDB = mssql_select_db("$_GET[Branch]");
$dateinwork = "$_POST[dw]/$_POST[mw]/$_POST[yw]";
$birthday = "$_POST[b1]/$_POST[b2]/$_POST[b3]";
$idcard_i = "$_POST[idcard_11]/$_POST[idcard_12]/$_POST[idcard_13]";
$idcard_o = "$_POST[idcard_21]/$_POST[idcard_22]/$_POST[idcard_23]";
$strSQL = "INSERT INTO EMPLOYEE (SH0,SH1,SH2,SH3,SH4,SH5) VALUES ('$_POST[SH0]','$_POST[SH1]','$_POST[SH2]','$_POST[SH3]','$dateinwork'',$_POST[SH5]')";
$objQuery = mssql_query($strSQL);
mssql_close($objConnect);
?>
มันฟ้องว่า
Warning: mssql_query() [function.mssql-query]: message: There are more columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement. (severity 15) in C:\AppServ\www\Admin\AddEmp1_Save.php on line 9
Warning: mssql_query() [function.mssql-query]: Query failed in C:\AppServ\www\Admin\AddEmp1_Save.php on line 9
ต้องแก้ตรงไหนเหรอคะ
Tag : - - - -
|
|
 |
 |
 |
 |
Date :
2010-02-27 16:03:35 |
By :
yingnoi |
View :
1489 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
$strSQL = "INSERT INTO EMPLOYEE (SH0,SH1,SH2,SH3,SH4,SH5) VALUES ('$_POST[SH0]','$_POST[SH1]','$_POST[SH2]','$_POST[SH3]','$dateinwork','$_POST[SH5]')";
|
 |
 |
 |
 |
Date :
2010-02-27 16:44:41 |
By :
io |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ข้อมูลที่ไม่ใช่ตัวเลขต้องมีเครื่องหมาย ' คร่อมอยู่ด้วย
|
 |
 |
 |
 |
Date :
2011-06-14 10:34:40 |
By :
ผ่านมา |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|