In Python, after I INSERT Into mysqldb, how do I get the "id"?

Posted by alex on Stack Overflow See other posts from Stack Overflow or by alex
Published on 2010-03-30T20:33:32Z Indexed on 2010/03/30 20:43 UTC
Read the original article Hit count: 230

Filed under:
|
|
|

The primary key.

cursor.execute("INSERT INTO mytable(height) VALUES(%s)",(height))

My table has 2 columns: 
id << primary, auto increment
height << this is the other column.

How do I get the "id", after I just inserted this?

© Stack Overflow or respective owner

Related posts about python

Related posts about mysql