Re: Re: MSSQL equivalent for mysql_insert_id ?
| From: | l0t3k | Date: | Tue, 06 Nov 2001 19:51:41 +0000 |
| Subject: | Re: Re: MSSQL equivalent for mysql_insert_id ? | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-14072@lists.php.net to get a copy of this message | ||
i havent actually tried it from PHP, though i use it from VBScript all the
time. iirc correctly though, you should be able to use it from MSSQL.
although functionally similar, i think the Sybase driver uses TDS whereas
the MSSQL driver uses DB Library.
<Richard Hillström (GIS)> wrote in message
news:1254192C94D3D411B8060008C7E6AEEBC850A8@esealnt408...
> I didnt know it was possible to use @@ variables in a php query.
> Cant get it to work to a Sybase server anyway and Sybase and MSSQL is
essentially the same thing.
> Can someone show me how it is done?
>
> Thanks
> //Richard
>
> -----Original Message-----
> From: l0t3k [mailto:cshmoove@hotmail.com]
> Sent: Tuesday, November 06, 2001 4:42 PM
> To: php-db@lists.php.net
> Subject: [PHP-DB] Re: MSSQL equivalent for mysql_insert_id ?
>
>
> its the value returned by the query "SELECT @@IDENTITY"
>
> Hace <why@do-youread.this> wrote in message
> news:3bead00e.10919721@news.php.net...
> >
> >
> > Is there a MSSQL equivalent for:
> >
> >
> > function getlastinsertedId ()
> > {
> > return mysql_insert_id();
> > }
> >
> >
> > I use the above function to retrieve the 'id' of the last inserted
> > record from an insert-query.
> >
> > If there is another way to accomplish the same thing with MS-SQL
> > server and PHP, please let me know.
> >
> > Thanks in advance,
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net