If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > PHP > Get id og last posted...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-04-03, 10:35
hhlundgaard hhlundgaard is offline
Registered User
 
Join Date: Sep 2003
Posts: 1
Question Get id og last posted...

I have a forum with DB2 using PHP and ODBC_connection when I insert a new thread in my DB I have to link the message to the thread table and to do that I need to get the ID of the thread that was just created.

the problem is how do I get the thread ID back and how do I make sure that it is exactly the one I created, let's say someone posted a new thread exactly the same time I did.??

The ID is of course auto incrementing so I don't know what ID a new thread will get. Is there some function or method that I can use to get the ID of a new just insertet thread??
Reply With Quote
  #2 (permalink)  
Old 09-13-03, 13:59
unatratnag unatratnag is offline
Registered User
 
Join Date: Jul 2003
Location: Ohio/Chicago
Posts: 75
check to see if DB2 supports the @@identity

i use MSsql so i can't promise you anything
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On