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