I'm kind of a newbie so sorry if this is an obvious question, but I could find a straight answer on the web.
I'm trying to use an id I got from
artid = c.insrt_id()
in an insert statement
c.execute("""INSERT into disc (title, artid, genre, year, created) VALUES (%s, %u, %s, %s, NOW())""",(id3info.album, artid, id3info.genre, id3info.year))
When I try running it I get an error that point to the c.execute statement and says
_mysql_exceptions.OperationalError: (1054, "Unknown column 'artid' in 'field list'")
I know this probably has to do with the id being a long int. Anyway I'm running python 2.1 and MySQL-python-0.9.1 According to the documentation python should handle the conversion automatically in 2.1.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm kind of a newbie so sorry if this is an obvious question, but I could find a straight answer on the web.
I'm trying to use an id I got from
artid = c.insrt_id()
in an insert statement
c.execute("""INSERT into disc (title, artid, genre, year, created) VALUES (%s, %u, %s, %s, NOW())""",(id3info.album, artid, id3info.genre, id3info.year))
When I try running it I get an error that point to the c.execute statement and says
_mysql_exceptions.OperationalError: (1054, "Unknown column 'artid' in 'field list'")
I know this probably has to do with the id being a long int. Anyway I'm running python 2.1 and MySQL-python-0.9.1 According to the documentation python should handle the conversion automatically in 2.1.
Use %s for all parameter placeholders.