]> wagnertech.de Git - timetracker.git/blobdiff - WEB-INF/lib/ttUserHelper.class.php
Ongoing refactoring, replacing the method to obtain last insert ids.
[timetracker.git] / WEB-INF / lib / ttUserHelper.class.php
index 2ff774ff5d29325aec9f597fd4f9a062bc354d1d..42d7c9109c06e52ef4e4c934c8920c4d8814bee0 100644 (file)
@@ -120,11 +120,7 @@ class ttUserHelper {
 
     // Now deal with project assignment.
     if (!is_a($affected, 'PEAR_Error')) {
-      $sql = "SELECT LAST_INSERT_ID() AS last_id";
-      $res = $mdb2->query($sql);
-      $val = $res->fetchRow();
-      $last_id = $val['last_id'];
-
+      $last_id = $mdb2->lastInsertID('tt_users', 'id');
       $projects = isset($fields['projects']) ? $fields['projects'] : array();
       if (count($projects) > 0) {
         // We have at least one project assigned. Insert corresponding entries in tt_user_project_binds table.