 |
[PHP]
มีปัญหา mssql_query Insert ข้อมูลลง MSSQL ไม่ได้ครับรบกวนผู้รู้หน่อย |
|
 |
|
|
 |
 |
|
There are more columns in the INSERT statement than values specified in the VALUES
insert into (ตรงนี้มี 6) values (ตรงนี้มีแค่ 5);
|
 |
 |
 |
 |
Date :
2014-04-21 14:57:29 |
By :
natt_han |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองปรับเป็น
mssql_query('INSERT INTO ' . $_CONFIG['mssql']['account_db_name'] . '.dbo.truemoney (card_id,password,user_no,amount,status,added_time) VALUES (NULL,\'' . $password . '\',' . $user_no . ',0,0,GETDATE())');
แล้วครับ ขึ้น
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\functions.php on line 100
ต้องปรับค่า null เป็นอย่างอื่นรึป่าว
|
 |
 |
 |
 |
Date :
2014-04-21 15:11:27 |
By :
BaNanaZ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้ามันติดที่ card_id และ card_id เป็น auto_inc ก็ไม่ต้องไป insert มันครับ ข้ามไปที่ password เลย
|
 |
 |
 |
 |
Date :
2014-04-21 15:27:34 |
By :
Manussawin |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วครับ ขอบคุณทุกท่าน
|
 |
 |
 |
 |
Date :
2014-04-21 15:29:47 |
By :
BaNanaZ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

|
 |
 |
 |
 |
Date :
2014-04-21 15:30:47 |
By :
Manussawin |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอา card_id กับ Null อันแรกออกครับ
|
 |
 |
 |
 |
Date :
2014-04-21 15:40:02 |
By :
itpcc |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|