I'm have some problems and its more then likely something really dumb that i missed and i feel kind bad post something on here about this but if you guys could help it would be nice heres my code
import MySQLdb
# Open database connection
db = MySQLdb.connect("localhost", "testuser", "123", "test")
# prepare a cursor object using cursor() method
cursor = db.cursor()
# Prepare SQL query to INSERT a record into the database.
number = 300
number1 = 5001
sql = "INSERT INTO PARTS (PART_NUMBER) VALUES (%d)"
try:
number = 300
# Execute the SQL command
cursor.execute(sql,(number,))
# Commit your changes in the database
db.commit()
print("Updated!")
except db.Error, e:
print "Error %d: %s" % (e.args[0],e.args[1])
# Rollback in case there is any error
db.rollback()
print("was rolled back")
# disconnect
db.close()
after i run it no problems but its not show up in my data base when recall the data back nothing can someone tell me why ? Thanks for your time.