prepare($sql); $stmt->bind_param( "sisssss", $data['title'], $data['priority'], $data['status'], $data['description'], $data['category'], $data['type'], $data['ticket_id'] ); // After successful update if ($stmt->execute()) { header('Content-Type: application/json'); echo json_encode([ 'success' => true, 'status' => $data['status'] // Send back the new status ]); } else { header('Content-Type: application/json'); echo json_encode([ 'success' => false, 'error' => $conn->error ]); } $stmt->close(); $conn->close();