Quantcast
Channel: MySQL Forums - Connector/Python
Viewing all articles
Browse latest Browse all 384

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

$
0
0
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:

mysql_connect.commit()

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

Viewing all articles
Browse latest Browse all 384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>