Python insert_id()

PHP의 mysql_insert_id() 와 같은 역할을 하는 python의 메쏘드나 프로퍼티

import MySQLdb db = Mysql.connect('db.db.com', 'test', 'test', 'test')
cursor = db.connection.cursor(MySQLdb.cursors.DictCursor)
cursor.excute("INSERT INTO table SET 'field' = 'value'")
print db.connection.insert_id()

cursor의 메쏘드가 아니라 db의 connection의 메쏘드 임을 유의

2008/07/29 13:38 2008/07/29 13:38
juniac
개발 2008/07/29 13:38

트랙백 주소 : http://juniac.net/trackback/141

댓글을 달아 주세요

[로그인][오픈아이디란?]

Powerd by Textcube, designed by criuce