Notice: Undefined index: in /data/phpspider/phplib/misc.function.php on line 226
什么';这个SQL代码语法有什么问题?_Sql - Fatal编程技术网

什么';这个SQL代码语法有什么问题?

什么';这个SQL代码语法有什么问题?,sql,Sql,我试图在我的脚本中实现这段代码,但我得到了一个语法错误 在ProspectBL中插入('customerNumber','namePerson1','LnamePerson1','street','city','state','zip','homePhone','Mobile','ClientFrient','clientLevel','closingDate','lastPaymentDate','currentBalance','ReparchaseDate','ReparchaseAmo

我试图在我的脚本中实现这段代码,但我得到了一个语法错误


在ProspectBL中插入('customerNumber','namePerson1','LnamePerson1','street','city','state','zip','homePhone','Mobile','ClientFrient','clientLevel','closingDate','lastPaymentDate','currentBalance','ReparchaseDate','ReparchaseAmount',拖欠余额')值('20713254','Sonia','Amaya','338 Railway Ave','Ctr Moriches','NY','11934','6318788386','6318137972','10/24/2002','1','7/26/2011','8/11/2011','792.15','0.00','0.00')

我得到的错误是:

您的SQL语法有错误;请查看与MySQL服务器版本对应的手册,以了解第2行“customerNumber”、“namePerson1”、“LnamePerson1”、“street”附近使用的正确语法

非常感谢您的帮助。

删除列名处的“”和最后一栏的

INSERT INTO prospectstbl ( customerNumber, namePerson1, LnamePerson1, street, city, 
state, zip, homePhone, cellPhone, clientSince, clientLevel, closingDate, 
lastPaymentDate, currentBalance, repurchaseDate, repurchaseAmount, delinquentBalance ) 
VALUES ('20713254', 'Sonia', 'Amaya', '338 Railroad Ave', 'Ctr Moriches', 'NY', '11934', '6318788386', '6318137972', '10/24/2002', '1', '7/26/2011', '8/11/2011', '$792.15', '', '$0.00', '$0.00') 

“拖欠余额”之后有一个逗号

使用

`
而不是

'
并在,
拖欠余额之后删除

或者您可以删除列的列表

INSERT INTO prospectstbl VALUES ('20713254', 'Sonia', 'Amaya', '338 Railroad Ave', 'Ctr Moriches', 'NY', '11934', '6318788386', '6318137972', '10/24/2002', '1', '7/26/2011', '8/11/2011', '$792.15', '', '$0.00', '$0.00')
IIRC,单引号(
)通常用于引用文字值(字符串等)并指示某些标记不是字段名。Graves(`)用于指示字段

试着用graves(`)来引用你的列名


另外,正如其他人所说,在列名列表的末尾有一个额外的逗号。请将其删除。

谢谢。问题是,在末尾。