Statement handles appear to have an accessor method to return the last 
insert id:
$new_id = $sth->insertid;

But I cannot seem to locate one for the database handle.  The closest I 
have found is the
$new_id = $dbh->{'mysql_insertid'};

In the case of a $dbh->do(...) where there is no statement handle, I have 
been using the above.

I'm concerned about writing code for the long term that references the 
internals of an object.  Is this guaranteed to stay this way forever?  Or, 
is there an accessor method on the database handle that I am not aware of?

Regards,
Rich


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to