Skip to content

Instantly share code, notes, and snippets.

@jeremejazz
Created March 12, 2013 09:06
Show Gist options
  • Save jeremejazz/5141340 to your computer and use it in GitHub Desktop.
Save jeremejazz/5141340 to your computer and use it in GitHub Desktop.
MSSQL Last Autoincrement ID
<?php
function mssql_insert_id() {
$id = 0;
$res = mssql_query("SELECT @@identity AS id");
if ($row = mssql_fetch_array($res)) {
$id = $row["id"];
}
return $id;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment