Re: mysqldb interfaceError
Hi!
First, you open a connection using MySQLdb.connect():
def __init__(self):
..
self.conn = MySQLdb.connect(host=..)
Then, you have to change the following execute-method too:
def execute(self, query):
cur = self.conn.cursor()
cur.execute(query)
self.conn.commit()
cur.close()
Even better is to get rid of this newFormat-function and do this:
def execute(self, query, data):
cur = self.conn.cursor()
cur.execute(query, data)
self.conn.commit()
cur.close()
Use the execute()-method like follows:
db.execute("INSERT INTO Format (form_name, form_width, form_height, form_fps) VALUES (%s,%s,%s,%s)", ('HD',0,0,0))
Cheers,
Geert
(sorry for the crappy forum code displaying..)
Geert Vanderkelen
Software Developer at Oracle