How do I show a user's credit based on their session

Posted by Jamie on Stack Overflow See other posts from Stack Overflow or by Jamie
Published on 2011-01-16T01:22:06Z Indexed on 2011/01/16 1:53 UTC
Read the original article Hit count: 488

Filed under:
|
|

Hi all - I'm developing a simple LAMP app where users can credit their account using Paypal. I suspect this is a simple issue, but have spent quite a while experimenting to no avail and would appreciate any thoughts:


System has a user management system working fine using sessions, but I can't get it to display the current user's credit.

But I've been trying things along the lines of:

$result = mysql_query("
SELECT *
FROM users
INNER JOIN account
ON account.UserID=account.UserID
ORDER BY account.accountID");

while($_SESSION['Username'] = $row['Username'] ) { echo $row['Username']; echo $row['Credit']; }

I suspect the while statement is invalid, but I want it to echo username and credit where the current session username = the username stored in the database.

Thanks so much for taking a look - very much appreciated.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql