<?php
include "connect.php";

$id      = $_POST['id'];
$name_ar = $_POST['name_ar'];
$name_en = $_POST['name_en'];

$stmt = $con->prepare("UPDATE `sub_specialties` SET `name_ar` = ?, `name_en` = ? WHERE `id` = ?");
$stmt->execute([$name_ar, $name_en, $id]);

if ($stmt->rowCount() > 0) {
    echo json_encode(array("status" => "success"));
} else {
    echo json_encode(array("status" => "fail"));
}
?>