简体   繁体   中英

Inserting into table using Python and MySQLdb

I am using Python and MySQLdb, I have a table which is displayed below but I get error message each time I try to insert into the table.

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")

You have two commas without anything between them. Remove one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM