I am writing my first python script, and I am trying to connect it to a mysql db to insert rows.
import MySQLdb
db = MySQLdb.connect("localhost","root","xxx","pytest" )
cursor = db.cursor()
cursor.execute("INSERT INTO `first_table` (`name`) VALUES ('boop') ")
When I check the mysql db via phpmyadmin, it contains no rows, however if the auto incrementing ID was 5 and then I run the script 2 times, when I insert a new row it inserts it as id= 8 so the script has been incrementing the primary key but not inserting the rows?
The script reports no mysql errors, so I'm a bit lost here.