Refactoring, finished with last insert ids.
[timetracker.git] / WEB-INF / lib / ttRoleHelper.class.php
index c14bc97..0686b1c 100644 (file)
@@ -173,10 +173,7 @@ class ttRoleHelper {
     if (is_a($affected, 'PEAR_Error'))
       return false;
 
-    $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_roles', 'id');
     return $last_id;
   }