note 100219 modified in book.mssql by danbrown
| From: | danbrown@php.net | Date: | Sat, 02 Oct 2010 15:18:02 +0000 |
| Subject: | note 100219 modified in book.mssql by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-172893@lists.php.net to get a copy of this message | ||
this function get inserted ident like function mysql_insert_id()
<?php
function mssql_insert_id() {
$id = 0;
$res = mssql_query("SELECT @@identity AS id");
if ($row = mysql_fetch_array($res, MYSQL_ASSOC)) {
$id = $row["id"];
}
return $id;
}
?>
--was--
this function get inserted ident like function mysql_insert_id()
function mssql_insert_id() {
$id = 0;
$res = mssql_query("SELECT @@identity AS id");
if ($row = mysql_fetch_array($res, MYSQL_ASSOC)) {
$id = $row["id"];
}
return $id;
}
http://php.net/manual/en/book.mssql.php