Re: Problem with INSERT into MS SQL db.
| From: | (desmond) | Date: | Fri, 21 Jul 2000 13:41:27 +0000 |
| Subject: | Re: Problem with INSERT into MS SQL db. | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1398@lists.php.net to get a copy of this message | ||
Dear Both,
Sorry to side-track a bit, I was wondering if you can share with me how
to setup the MSSQL connection on a redhat + php box? Thanks.
Marcin.Zylski@upc.com.pl (Zylski Marcin) wrote in
<05D57C621115D411AA7B00B0D0208972037DA4@AKA1EXC008>:
>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
>--
>
>