prepare("SELECT * FROM users WHERE id = ?"); $stmt->execute([$user_id]); $user = $stmt->fetch(); // Fetch Downloads (Join with Products) $sql = "SELECT o.id as order_id, o.created_at, p.title, p.image, p.file_path FROM orders o JOIN products p ON o.product_id = p.id WHERE o.user_id = ? AND o.status = 'success' ORDER BY o.id DESC"; $stmt = $pdo->prepare($sql); $stmt->execute([$user_id]); $downloads = $stmt->fetchAll(); ?>
| Product | Order ID | Date | Action |
|---|---|---|---|
|
|
#= $item['order_id'] ?> | = date('d M Y', strtotime($item['created_at'])) ?> | Download |