Jump to content

Refreshin Information


Drezard

Recommended Posts

Hello, I have my web game currently running (I know its not very good) on www.wintersword.com. Now with the stats bar on the top left of the page, whenever i make updates to the stats bar it always makes them on the next page not on the same page. Here is the stats bar script:

 

function chars_viewstatsbar() {

  $explode = explode(" ", $_SESSION['userinfo']);
  $username = $explode[0];

  $query = "SELECT level, exp_cur, exp_max, hp_cur, hp_max, mp_cur, mp_max, gold FROM user_currents WHERE username='$username'";
  
  $result = mysql_query($query);
  
  $db_array = mysql_fetch_array($result);
  
  echo "<p> <a href='view_stats.php'>$username Stats</a>: <br>";
  echo "Level: $db_array[0] Exp: $db_array[1] / $db_array[2] <br>";
  echo "Health: $db_array[3] / $db_array[4] <br>"; 
  echo "Mana: $db_array[5] / $db_array[6]<br>";
  echo "Gold: $db_array[7]";

}

 

and yes its inside a proper class file and such and connects to the database else where. But... What i want it to do is basically whenever an update is made to that part of the database, i want it to update the stats.

 

You can check it at www.wintersword.com..

 

- Cheers, Daniel

Link to comment
https://forums.phpfreaks.com/topic/44081-refreshin-information/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.