MySQL Forums
Forum List  »  Connector/Python

Re: datetime insert error
Posted by: Dillon Dillon
Date: September 13, 2018 08:44AM

Hi,

I have the same problem too.

my code looks like this:

now_time=datetime.now().strftime('%Y-%m-%d %H:%M:%S')
insert_sql = ("INSERT INTO master_check_data (master_time) VALUES ( %s )")
c2_master.execute(insert_sql,now_time)

1064 (42000): 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 '%s )' at line 1

Options: ReplyQuote


Subject
Written By
Posted
September 12, 2018 03:11AM
Re: datetime insert error
September 13, 2018 08:44AM
September 13, 2018 09:37AM
September 17, 2018 03:16AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.