Hello,
I have been programming for a while but pretty new to PHP. I am have run into a problem. My site has a login/register screen and once logged into the account, I am trying to echo information from the users database entry. For example if I want to display the content “Balance” I have been trying the following code:
[php]<?php $data = mysql_query(“SELECT * FROM users WHERE username=username”)
or die(mysql_error()); while($info = mysql_fetch_array( $data )) { Print $info[‘balance’]; } ?>[/php]
The idea is that the script will query the database using the username stored in the session then goto the named field.
When there is only one registered user, it appears to work, however; once multiple users enroll, it echoes the value from ALL users (ex. $7.50$10.12).
Thanks for your help in resolving this issue!