db->query($s); $r = $q->fetchArray(SQLITE3_ASSOC); $this->uid = $r["uid"]; $this->id = $r["id"]; $this->name = HTML::e($r["name"]); $this->description = HTML::e($r["description"]); $this->area = new K_Area($this->db, $r["area"], $r["area_type"]); $this->stage = $r["stage"]; if ($complete){ $s = " SELECT unit FROM team_unit WHERE team = '$id'; "; $q = $this->db->query($s); while ($r = $q->fetchArray(SQLITE3_ASSOC)){ array_push($this->unit, new Unit($this->db, $r["unit"], false)); } } } } ?>