note 82243 added to function.mssql-get-last-message

From: Date: Wed, 02 Apr 2008 12:57:03 +0000
Subject: note 82243 added to function.mssql-get-last-message
Groups: php.notes 
Request: Send a blank email to php-notes+get-137857@lists.php.net to get a copy of this message
I found a very cool shortcut when dealing with last insert id's (or IDENTITY as it's called here) $q = mssql_query("INSERT INTO TableName(...) VALUES(...) SELECT LAST_INSERT_ID=@@IDENTITY"); $r = mssql_fetch_assoc($q); $r['LAST_INSERT_ID'] will contain your new IDENTITY. Source: http://www.tumanov.com/entry/435 ---- Server IP: 69.147.83.197 Probable Submitter: 71.179.183.68 ---- Manual Page -- http://www.php.net/manual/en/function.mssql-get-last-message.php Edit -- https://master.php.net/note/edit/82243 Del: integrated -- https://master.php.net/note/delete/82243/integrated Del: useless -- https://master.php.net/note/delete/82243/useless Del: bad code -- https://master.php.net/note/delete/82243/bad+code Del: spam -- https://master.php.net/note/delete/82243/spam Del: non-english -- https://master.php.net/note/delete/82243/non-english Del: in docs -- https://master.php.net/note/delete/82243/in+docs Del: other reasons-- https://master.php.net/note/delete/82243 Reject -- https://master.php.net/note/reject/82243 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#137857) next »