Paul DuBois wrote:
> That's because, to be safe, you should cast the value of mysql_insert_id()
> to a safe value. It returns a my_ulonglong value, which doesn't print
> correctly on some systems. I used:
Well, just forgot the cast when writing this code from memory ;-). BTW I
haven't yet used real "long long"s, what do I need for them? Is that a
feature of the egcs compilers? I always have a somewhat queasy feeling
when casting long long to unsigned long :-/...
> It seems that accessing last_insert_id() in a SQL statement somehow
> messes up the C API mysql_insert_id() function. I don't see anything in the
> manual that would lead me to expect this...
Maybe some of the MySQL professionals could elaborate on this?
> Executing the equivalent statements in SQL doesn't seem to have the same
> problem:
Heh, just wanted to add this myself ;-). If I see things right,
mysql_insert_id is client-side, LAST_INSERT_ID is server-side. Is there
a discrepancy in implementation?
Matthias
--
w e b f a c t o r y | matthias pigulla
www.webfactory.de mp@stripped