query($query); if(!$result){ echo "Произошли неполадки при регистрации: ". $mysql->error; } //Response $query = "SELECT * FROM users WHERE `email` = '$email'"; $result = $mysql->query($query); if(!$result){ echo "Произошли неполадки при получении email: ". $mysql->error; } $id = $result->fetch_assoc()["id"]; $data = [ "id" => $id, "name" => $name, "surname" => $surname, "address" => $address, "email" => $email, "result" => true ]; header('Content-Type: application/json;charset=utf-8'); echo json_encode($data);