Problem with INSERT into MS SQL db.

From: Date: Mon, 15 May 2000 11:31:41 +0000
Subject: Problem with INSERT into MS SQL db.
Groups: php.db 
Request: Send a blank email to php-db+get-20@lists.php.net to get a copy of this message
Hi !!! Have you ever met with problems while insertign some data into MS SQL 7.0 db ? I was trying something like this: $request=mssql_query("INSERT INTO jobs (job_desc,min_lvl,max_lvl) VALUES ('Accountant',12,125) SELECT @@IDENTITY AS 'Identity';", $connect); //$connect is active link identifier to my db. Table jobs (example taken from ms sql manual - I'm working with very similar structure) has one identity column. According to MS SQL manual, sequencie in insert should return last value of identity colum, and it's workin. I've checked it in direct connection to db. But when I use it in my script and then try to get identity value with mssql_fetch_row($request); (or any similar function) I have message from PHP parser that $request is NOT an index of mssql_query result. What shall I do to get this value? Any help urgently needed! -- -- Marcin Żylski, dział IT -- email: marcin.zylski@upc.com.pl -- tel. +48 32 20 07 485 --

« previous php.db (#20) next »