if (is_a($affected, 'PEAR_Error'))
return false;
+ // Delete client binds to this project.
+ $sql = "delete from tt_client_project_binds where project_id = $id and group_id = $group_id and org_id = $org_id";
+ $affected = $mdb2->exec($sql);
+ if (is_a($affected, 'PEAR_Error'))
+ return false;
+
return true;
}
$affected = $mdb2->exec($sql);
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_projects', 'id');
// Bind the project to users.
$active_users = ttTeamHelper::getActiveUsers(array('getAllFields'=>true));