PHP 4.0 Bug #8786: odbc_insert_id()
| From: | stuarth at generalsearch dot net | Date: | Thu, 18 Jan 2001 16:19:49 +0000 |
| Subject: | PHP 4.0 Bug #8786: odbc_insert_id() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-44489@lists.php.net to get a copy of this message | ||
From: stuarth@generalsearch.net
Operating system: Any
PHP version: 4.0.4pl1
PHP Bug Type: Feature/Change Request
Bug description: odbc_insert_id()
Some way of accessing the most recently-inserted row would be very useful. This could be done
either by an odbc version of mysql_insert_id(), or (preferably) odbc_exec() returning a pointer to
the newly-inserted row so that odbc_fetch_row() and odbc_fetch_into() can retrieve the data.
I need this because I need to access any identity fields (the closest mysql equivalent is
auto_increment) that were created during an insert since I tend to use these as keys and have
foreign keys in other tables pointing to them.
The 2nd way is preferable because it ensures that a very busy SQL server will not return any inserts
that may have been done in between the insert command and the odbc_insert_id() command. (Even if
they're back-to-back, you may still have an insert sneak in between if the server is constantly
being accessed.)
--
Edit Bug report at: http://bugs.php.net/?id=8786&edit=1