samedi 30 juillet 2016

How to create multiple mysql tables with MySQLdb in python?

This is what i am trying to do:

cursor.execute("CREATE DATABASE testing")
cursor.execute("USE testing")
cursor.execute("CREATE TABLE Contract(mEnd varchar(7))")    
cursor.execute("CREATE TABLE User(uName varchar(15)")

When I run the python script using MySQLdb it only creates the first table and it ignores all the other lines of code.

Aucun commentaire:

Enregistrer un commentaire