Here's my Function/Class
class user
{
public function get_data($username)
{
global $pdo;
$query = $pdo->prepare("SELECT * WHERE user_name = ?"); //display oldest to newest
$query->bindValue(1, $username);
$query->execute();
return $query->fetch();
}
}
Here's how I do my Call.
$users = new user;
$user = $users->get_data($_POST['username']);
$_SESSION['username'] = $user['user_name'];
$_SESSION['id'] = $user['user_id'];
$_SESSION['credits'] = $user['user_credits'];
Here's my HTML
<li class="right"><a href="#">Hello, <?php echo $_SESSION['username']; ?>.</a></li>
<li class="right"><?php echo $_SESSION['credits']; ?></li>
<li class="right"><?php echo $_SESSION['id']; ?></li>
So for some reason, only the $_SESSION['username']; print's out in the html, the credit/id doesn't have a value so it doesn't display anything, is my query right? I think it should work if the username is being displayed.