mssql: insert a record and return the auto increment ID

From: Date: Mon, 02 Sep 2002 13:27:41 +0000
Subject: mssql: insert a record and return the auto increment ID
Groups: php.db 
Request: Send a blank email to php-db+get-21516@lists.php.net to get a copy of this message
I insert a new record with PHP into my MS SQL Server database. The key is defined with auto_id INT IDENTITY(1000,1) NOT NULL, how do I get the new id to use it in PHP? To insert the record I use this code: $sSql = "INSERT INTO myTable (time_in ) VALUES ( getdate() )"; $pResult = mssql_query($sSql, $g_pDBServer); Thanks a lot for your help Heiko

« previous php.db (#21516) next »