prepare("SELECT * FROM `persistence` WHERE `ip`=\"$ip\" AND `placeId`=:pid AND `scope`=:scope AND `type`=:type AND `key`=:key AND `target`=:target"); $stmt->bindParam(':key', $key, PDO::PARAM_STR); $stmt->bindParam(':pid', $pid, PDO::PARAM_INT); $stmt->bindParam(':scope', $scope, PDO::PARAM_STR); $stmt->bindParam(':type', $type, PDO::PARAM_STR); $stmt->bindParam(':target', $target, PDO::PARAM_STR); $stmt->execute(); $result = $stmt->fetchAll(PDO::FETCH_ASSOC); foreach($result as &$data){ array_push($values,array("Value"=>$data["value"],"Scope"=>$data["scope"],"Key"=>$data["key"],"Target"=>$data["target"])); } $conn=null; exit(json_encode(["data"=>$values], JSON_NUMERIC_CHECK)); } } exit(json_encode(["error"=>"This driver can't. He just can't. Don't push him."])); } exit(json_encode(["error"=>"Failed to fetch client address."])); ?>