2011-09-25 31 views
0

我正在使用Python和MySQLdb,我有一个表显示在下面,但我每次尝试插入表时都会收到错误消息。使用Python和MySQLdb插入表

INSERT INTO reviews (entry,created_time, user_id, branch_id, title)VALUES('branches that would lead use to the ciyrt', '2011-09-20 00:24:24',1, ,1, 'oogletivers')

CREATE TABLE reviews 
    (
    id int(9) unsigned not null primary key auto_increment, 
entry text not null , 
created_time timestamp not null, 
user_id tinyint unsigned not null references users(id), 
branch_id tinyint unsigned not null references branches(id), 
title varchar(255), 
FULLTEXT(title, entry) 
    ) 

mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1, 'oogletivers')' at line 1")

回答

1

你有两个逗号,他们之间没有任何东西。删除一个。

+0

谢谢,我不能相信我会错过这个。 – user618677