From 782e41405f50d514ee0b9bc33e22e51f8006fc64 Mon Sep 17 00:00:00 2001 From: Robert Anderson <randerson@lbsd.net> Date: Mon, 11 May 2009 15:02:22 +0000 Subject: [PATCH] Added lastInsertID function --- webgui/include/db.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/webgui/include/db.php b/webgui/include/db.php index 4b053508..693ed819 100644 --- a/webgui/include/db.php +++ b/webgui/include/db.php @@ -390,6 +390,24 @@ function DBSelectSearch($query,$search,$filters,$sorts) { } +## @fn DBLastInsertID($table,$column) +# Function to get last insert id +# +# @param table Table to check +# @param column Column to get last insert on +# +# @return Last insert ID or undef on error +function DBLastInsertID() +{ + global $db; + + # TODO: Implement $table nad $column?? + $res = $db->lastInsertID(); + + return $res; +} + + # Connet to database when we load this file $db = connect_db(); -- GitLab