prepare("SELECT * FROM open_servers WHERE gameID = :pid AND jobid = :jid AND status = 1"); $q->bindParam(":pid", $placeid, PDO::PARAM_INT); $q->bindParam(":jid", $jobid, PDO::PARAM_STR); $q->execute(); if($q->rowCount() > 0) { if ($shutdownserver) { //soapclosejob doesnt have any return data, so we set message to true soapCloseJob($GLOBALS['gamesArbiter'],$jobid); $message = true; } if ($message === true) { $message = "Success"; } header('Content-Type: application/json'); echo json_encode(array("alert" => $message)); } }