0 && ($status == 0 || $status == 1)) { // Update comment status $qry = "UPDATE comment SET status = $status WHERE id = $c_id"; $run = mysqli_query($conn, $qry); if ($run) { // Display alert and redirect echo ""; exit; } else { echo "Error updating status: " . mysqli_error($conn); } } else { echo "Invalid request."; } // Close the database connection mysqli_close($conn); ?>