MySQL Forums
Forum List  »  Connector/Python

Is the mysql_connect.commit() always require with Insert, Update and Delete records?
Posted by: Ernest Bonat
Date: March 12, 2014 10:41AM

I’m trying to insert a new record into the magazine_type table following the code below:

sql = ('INSERT INTO magazine_type (type, description, notes, update_id) VALUES (%s, %s, %s, %s)')
paremeters = ('Lunix', 'The Lunix Magazine', 'The Notes', 300)
cursor = mysql_connect.cursor()
cursor.execute(sql, parameters)

The record will not be inserted until the commit() method of the connection object is done as:


Is the mysql_connect.commit() always required with Insert, Update and Delete records?

Options: ReplyQuote

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.