Jump to content

grabbing info from database problem


fix3r

Recommended Posts

I didn't know where to put this, so I put it in both places. If this isn't aloud please delete the place where it is innapropriate to put it in.

[code]http://www.phpfreaks.com/forums/index.php/topic,112357.0.html[/code]

On the top of my page it shows the stats of players if they are logged in..for example, money used..attacks..unread messages..ect. Or if they aren't logged in, it telle them that they need to log in.

When someone logs in, it redirects them to the menu page where it also gives them a little info about the person.

Now here is where the problem is, when they log in and it redirects you to the page, neither top where it shwos the player's stats or the menu tells them how much of "whatever" they have. It says they have 0. But once you refersh it tells them an exact ammount of what they have.

I'm going to show you some of my code but if anyone needs anymore to figure out what the problem would be please tell me.

[b]Config:[/b]
[code]
$result = mysql_query("SELECT * FROM users WHERE username='" . decrypt($_SESSION['login']) . "'");
$rs = mysql_fetch_array($result);
[/code]

[b]Part of index where info is displayed:[/b]
[code]
echo'<td width="15%">Money:&nbsp;<b>$' . number_format($rs['moneyout']) . '</b></td>';
echo'<td width="15%">Power:&nbsp;<b>' . number_format($rs['power']) . '</b></td>';
echo'<td width="15%">Attacks:&nbsp;<b>' . number_format($rs['attacks']) . '</b></td>';
[/code]

I apprecate your help, thank you.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.