len wrote: > I have started a little pet project to learn python and MySQL. The > project involves figuring out all the combinations for a 5 number > lottery and storing the data in a MySQL file.
> import MySQLdb > cursor.executemany('''insert into > littlelottery > values (?,?,?,?,?,?,?,?,?)''', listofrec) > i get the following error on insert; > raise errorclass, errorvalue > TypeError: not all arguments converted during string formatting > Script terminated. > > Do I have to covert all of the fields in the tuple records to string > or what? >>> import MySQLdb >>> MySQLdb.paramstyle 'format' So it looks like you need to replace the '?' in your SQL statement with '%s'. Peter -- http://mail.python.org/mailman/listinfo/python-list