php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #13966 insert id function for ODBC
Submitted: 2001-11-06 18:55 UTC Modified: 2002-09-11 01:00 UTC
Votes:6
Avg. Score:4.5 ± 0.5
Reproduced:5 of 5 (100.0%)
Same Version:2 (40.0%)
Same OS:3 (60.0%)
From: john at mailsrv dot bidbay dot com Assigned:
Status: No Feedback Package: Feature/Change Request
PHP Version: 4.0.6 OS: all OSes
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: john at mailsrv dot bidbay dot com
New email:
PHP Version: OS:

 

 [2001-11-06 18:55 UTC] 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



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-10 18:23 UTC] kalowsky@php.net
What do you mean by id?

 [2002-09-11 01:00 UTC] 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".
 [2003-05-12 07:17 UTC] nospam at nospam dot com
he means a function like mysql_insert_id
which return the last ID ( auto_increment ) of insert query
 [2003-08-04 06:28 UTC] seang at moosecat dot com dot au
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 15:01:29 2024 UTC