// 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.