I am (very!) new to MySQL, so I just started coding with/in it. My Code: PHP: public function getCurrentSlots($server) { $status = "current"; $result = $this->database->query("SELECT * FROM slots WHERE status='$status' AND server='$server'"); // That's Line 83 if ($result instanceof \mysqli_result) { $data = $result->fetch_assoc(); $result->free(); if (isset($data["server"]) and $data["server"] === $server) { unset($data["server"]); return $data["amount"]; } } return null; } Error when using the function: Code: Fatal error: Call to a member function query() on null in C:\Users\fuego\Desktop\Programmieren\Server\PocketMine-MP\plugins\MySQL\src\BukkitPlaysMC\Slots\Main.php on line 83 Can anyone tell me what's wrong? :/