<?php
include "../db.php";

$id=$_GET['id'];

$r=$conn->query("SELECT status FROM menus WHERE id=$id");

$row=$r->fetch_assoc();

$newStatus = $row['status'] ? 0 : 1;

$conn->query("UPDATE menus SET status=$newStatus WHERE id=$id");

echo "ok";
?>