prepare("UPDATE cars_sale_inventory SET status='sold' WHERE id = ?"); if(!$stmt) throw new Exception('שגיאה בהכנת השאילתה: ' . $conn->error); $stmt->bind_param('i', $id); if(!$stmt->execute()) throw new Exception('שגיאה בעדכון הסטאטוס: ' . $stmt->error); echo json_encode(['success' => true]); } catch(Exception $e) { http_response_code(400); echo json_encode(['success' => false, 'error' => $e->getMessage()]); } ?>