RE: [PHP] Retrieve value of newly inserted row.
| From: | Brad Fuller | Date: | Wed, 14 Feb 2007 18:51:38 +0000 |
| Subject: | RE: [PHP] Retrieve value of newly inserted row. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-248880@lists.php.net to get a copy of this message | ||
> >From looking on the web (MSDN) I found the @@identity and the explanation
> of
> what it is, but MS's "example" is horrible and does not show a good
> context
> for using this function. Could you elaborate more on its use?
$q = mssql_query("INSERT INTO TableName(...) VALUES(...) SELECT
LAST_INSERT_ID=@@IDENTITY");
$r = mssql_fetch_assoc($q);
HTH,
Brad