mysqli error handling
This commit is contained in:
parent
effc3c500c
commit
1386e00ce3
@ -357,14 +357,18 @@ class ServerRankingPlugin implements Plugin, CallbackListener, CommandListener {
|
|||||||
$mysqli = $this->maniaControl->database->mysqli;
|
$mysqli = $this->maniaControl->database->mysqli;
|
||||||
|
|
||||||
$result = $mysqli->query('SELECT * FROM ' . self::TABLE_RANK . ' WHERE PlayerIndex=' . $player->index);
|
$result = $mysqli->query('SELECT * FROM ' . self::TABLE_RANK . ' WHERE PlayerIndex=' . $player->index);
|
||||||
if ($result->num_rows > 0) {
|
if ($mysqli->error) {
|
||||||
$row = $result->fetch_array();
|
trigger_error($mysqli->error);
|
||||||
$result->free_result();
|
return null;
|
||||||
return Rank::fromArray($row);
|
}
|
||||||
} else {
|
if ($result->num_rows <= 0) {
|
||||||
$result->free_result();
|
$result->free_result();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$row = $result->fetch_array();
|
||||||
|
$result->free_result();
|
||||||
|
return Rank::fromArray($row);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user