]> wagnertech.de Git - timetracker.git/blobdiff - WEB-INF/lib/ttInvoiceHelper.class.php
A bit more refactoring.
[timetracker.git] / WEB-INF / lib / ttInvoiceHelper.class.php
index 3d67f6a787b973610556a4ba9342af15f2feea27..41dace01bfb86f17b0368105c53950f4e4ae954e 100644 (file)
@@ -56,12 +56,7 @@ class ttInvoiceHelper {
 
     if (is_a($affected, 'PEAR_Error')) return false;
 
-    $last_id = 0;
-    $sql = "select last_insert_id() as last_insert_id";
-    $res = $mdb2->query($sql);
-    $val = $res->fetchRow();
-    $last_id = $val['last_insert_id'];
-
+    $last_id = $mdb2->lastInsertID('tt_invoices', 'id');
     return $last_id;
   }