RE: [PHP-DB] Re: MSSQL equivalent for mysql_insert_id ?
| From: | GIS) | Date: | Tue, 06 Nov 2001 15:49:53 +0000 |
| Subject: | RE: [PHP-DB] Re: MSSQL equivalent for mysql_insert_id ? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-14054@lists.php.net to get a copy of this message | ||
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