- // Update created_by field for the team with user id, now that we have it.
- $sql = "update tt_teams set created_by = $user_id where id = $this->group_id and created_by is null";
- $affected = $mdb2->exec($sql);
+ // The setCreatedBy sets created_by field for both group and user to passed in user_id.
+ function setCreatedBy($user_id) {
+ if ($this->err->yes()) return false; // There are errors, do not proceed.
+
+ global $i18n;
+ $mdb2 = getConnection();