prepare("SELECT * FROM users WHERE id = ?"); $userStmt->execute([$user_id]); $user = $userStmt->fetch(); // Fetch User's Car Listings $carStmt = $db->prepare("SELECT * FROM cars WHERE user_id = ? AND is_deleted = 0 ORDER BY created_at DESC"); $carStmt->execute([$user_id]); $myCars = $carStmt->fetchAll(); // Fetch Recent Purchases $pStmt = $db->prepare("SELECT purchases.*, cars.title as car_title FROM purchases JOIN cars ON purchases.car_id = cars.id WHERE purchases.user_id = ? ORDER BY purchase_date DESC"); $pStmt->execute([$user_id]); $myPurchases = $pStmt->fetchAll(); // Fetch Notifications $nStmt = $db->prepare("SELECT * FROM notifications WHERE user_id = ? ORDER BY created_at DESC LIMIT 5"); $nStmt->execute([$user_id]); $notifications = $nStmt->fetchAll(); ?>
You haven't purchased any cars yet.
| Transaction ID | Car | Bank | Amount | Date |
|---|---|---|---|---|
| $ |
No notifications at this time.