db.insert_id() is always returning 0 for me, while "SELECT LAST_INSERT_ID()" is returning the correct value. I would rather not do a whole other query. Has anyone else seen that?
Thanks.
Red Hat RHEL4
mysql-4.1.7
python-2.3.4-14
MySQL-python-1.2.0
(No, I can't upgrade any of these. My client needs this specific set of packages.)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks! I'm fixing someone else's code, as well as porting it from Windows to Linux, and they were using insert_id(). Sorry I didn't see this one in the docs. Serves me right for trusting Google first.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
db.insert_id() is always returning 0 for me, while "SELECT LAST_INSERT_ID()" is returning the correct value. I would rather not do a whole other query. Has anyone else seen that?
Thanks.
Red Hat RHEL4
mysql-4.1.7
python-2.3.4-14
MySQL-python-1.2.0
(No, I can't upgrade any of these. My client needs this specific set of packages.)
Don't use db.insert_id(); that's used internally. Instead:
http://www.python.org/dev/peps/pep-0249/
Thanks! I'm fixing someone else's code, as well as porting it from Windows to Linux, and they were using insert_id(). Sorry I didn't see this one in the docs. Serves me right for trusting Google first.