Skip to content

Commit

Permalink
Fixes fatal error when loading classes/member.php
Browse files Browse the repository at this point in the history
  • Loading branch information
deepend-tildeclub committed Jan 30, 2024
1 parent 8623844 commit fcdc8e8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/classes/member.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,21 +196,26 @@ function getTournamentList($creatorOnly = false) {
$result = $this->MySQL->query($query);
while ($row = $result->fetch_array()) {
$returnArr[] = $row['tournament_id'];
}
}

$query = "SELECT tournament_id FROM ".$this->MySQL->get_tablePrefix()."tournament_managers WHERE member_id = '".$this->intTableKeyValue."'";
$result = $this->MySQL->query($query);
while ($row = $result->fetch_assoc()) {
$returnArr[] = $row['tournament_id'];
}
} else {
$teamArr = [];

$query = "SELECT * FROM ".$this->MySQL->get_tablePrefix()."tournamentplayers WHERE member_id = '".$this->intTableKeyValue."'";
$result = $this->MySQL->query($query);
while ($row = $result->fetch_array()) {
$teamArr[] = $row['team_id'];
}

$teamSQL = "('".implode("','", $teamArr)."')";
if (!empty($teamArr)) {
$teamSQL = "('".implode("','", $teamArr)."')";
} else {
$teamSQL = "('')";
}

$query = "SELECT * FROM ".$this->MySQL->get_tablePrefix()."tournamentteams WHERE tournamentteam_id IN ".$teamSQL;
$result = $this->MySQL->query($query);
Expand Down

0 comments on commit fcdc8e8

Please sign in to comment.