prepare($query); $stmt->execute(); $result = $stmt->fetch(PDO::FETCH_ASSOC); DB::closeConnection($db); echo json_encode($result);