]> wagnertech.de Git - timetracker.git/blobdiff - WEB-INF/lib/ttFavReportHelper.class.php
A bit more refactoring.
[timetracker.git] / WEB-INF / lib / ttFavReportHelper.class.php
index f1943f71f8a7fdb913f7c8b368c531b17645dddb..36600e2194685d7a501eb5843e1b5d50aecd9279 100644 (file)
@@ -107,13 +107,8 @@ class ttFavReportHelper {
     if (is_a($affected, 'PEAR_Error'))
       return false;
 
-    $sql = "select last_insert_id() as last_id";
-    $res = $mdb2->query($sql);
-    if (is_a($res, 'PEAR_Error'))
-      return false;
-
-    $val = $res->fetchRow();
-    return $val['last_id'];
+    $last_id = $mdb2->lastInsertID('tt_fav_reports', 'id');
+    return $last_id;
   }
 
   // updateReport - updates report options in the database.