ID: 13966
Comment by: seang at moosecat dot com dot au
Reported By: john at mailsrv dot bidbay dot com
Status: No Feedback
Bug Type: Feature/Change Request
Operating System: all OSes
PHP Version: 4.0.6
New Comment:
I have something like this when using odbc for MS SQL - apparently
works for access 2000 too.
$temp = odbc_exec($conn, "SET NOCOUNT ON");
$result = odbc_exec($conn,$sql);
$result = odbc_exec($conn, "SELECT @"."@IDENTITY AS Ident");
$rc = odbc_fetch_into($result, $row);
echo "Array value :".var_dump($row)."<br>";
echo "Getting record id :".$row[0]."<br>";
Hope that helps I know I have searched for this quite a few times....
seang.
Previous Comments:
------------------------------------------------------------------------
[2003-05-12 07:17:46] nospam at nospam dot com
he means a function like mysql_insert_id
which return the last ID ( auto_increment ) of insert query
------------------------------------------------------------------------
[2002-09-11 01:00:02] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2002-08-10 18:23:54] kalowsky@php.net
What do you mean by id?
------------------------------------------------------------------------
[2001-11-06 18:55:58] john at mailsrv dot bidbay dot com
is it possible to get a function like:
odbc_insert_id()
??
i'm guessing this might cause a problem.. not being able to support
some dbs. but it would be nice for those dbs that do support it. or
is there already a way to do this that i've just missed in the doc
somewhere.
thanks!
John
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=13966&edit=1