Dennis Lee Bieber <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]:
> dictCursor > RETURNS the results as a dictionary; it doesn't affect how > parameters are passed in. thats how I was using it > > Normally results are a (list or tuple) where you have to know the > order of the fields specified in the query: > > cr.execute("select a, c, b from table") > dt = cr.fetchone() > > dt is a (list/tuple) with (a_value, c_value, b_value) > > With a dictCursor you get > > dcr.execute("select a, c, b from table") > ddt = dcr.fetchone() > > ddt is a dictionary of {"a" : a_value, "b" : b_value, "c" : c_value} > > > MySQLdb nominally uses just the %s placeholder style, but I think it > will also function with %(name)s format... > > cr.execute( > "insert into table (c, a, b) values (%(c)s, %(a)s, %(b)s", > ddt) sounds a lot simpler, ill give it a go later. thanks -- http://mail.python.org/mailman/listinfo/python-list