prepare(" SELECT p.*, c.brand, c.model, c.year, c.price FROM purchases p JOIN cars c ON p.car_id = c.id WHERE p.user_id = ? ORDER BY p.created_at DESC "); $purchases->execute([$userId]); $myPurchases = $purchases->fetchAll(); // Fetch user's listings $listings = $pdo->prepare(" SELECT * FROM cars WHERE user_id = ? AND deleted_at IS NULL ORDER BY created_at DESC "); $listings->execute([$userId]); $myCars = $listings->fetchAll(); require_once __DIR__ . '/includes/header.php'; ?>

Welcome,

Manage your car listings and view your purchase history.

Sign Out

My Listings

+ List New Car

You haven't listed any cars yet.

Start Selling

Recent Activity

Purchase History

No purchases found.

$
Completed