Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003

    Question Unanswered: 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??

  2. #2
    Join Date
    Jul 2003
    check to see if DB2 supports the @@identity

    i use MSsql so i can't promise you anything

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts