prepare(" SELECT c.*, u.name as seller_name, ci.image_path FROM cars c JOIN users u ON c.user_id = u.id LEFT JOIN car_images ci ON c.id = ci.car_id AND ci.is_main = 1 WHERE c.id = ? AND c.deleted_at IS NULL AND (c.status = 'approved' OR c.status = 'sold') "); $stmt->execute([$id]); $car = $stmt->fetch(); if (!$car) { header('Location: cars.php'); exit; } // Fetch all images $stmt = $pdo->prepare("SELECT image_path FROM car_images WHERE car_id = ?"); $stmt->execute([$id]); $images = $stmt->fetchAll(PDO::FETCH_COLUMN); ?>
Year: = $car['year'] ?> | Status: = ucfirst($car['status']) ?>
Current Price
Seller
= htmlspecialchars($car['seller_name']) ?>
Every listing is manually verified by our team. Personal information and bank IDs are encrypted and used only for legal documentation.