prepare("SELECT credits FROM users WHERE id = ?"); $stmt->execute([$userId]); $user = $stmt->fetch(); $user_credits = $user ? $user['credits'] : 0; // Fetch purchase history $stmt = $pdo->prepare( "SELECT p.credits_purchased, p.amount_paid, p.created_at, pl.name as plan_name " . "FROM purchases p " . "JOIN plans pl ON p.plan_id = pl.id " . "WHERE p.user_id = ? ORDER BY p.created_at DESC" ); $stmt->execute([$userId]); $purchases = $stmt->fetchAll(PDO::FETCH_ASSOC); ?>

Billing & Credits

View your credit balance and purchase history.

Your Credits

Buy More Credits
Purchase History
Date Package Credits Amount
+ $

You have not made any purchases yet.