Jump to content
MakeWebGames

health stats


DreamCoder

Recommended Posts

Ok im not sure if im doing this correctly but i need some help here dominion says im on the right track

<?php

require('config.php');

$health == 100;

if ($health < 99) {

mysql_query("UPDATE `health` SET 'health' = 100 WHERE 'health <99'");

}

$user = mysql_fetch_array(mysql_query("SELECT `lastHP_Time` FROM `members` WHERE `userid`=". $_SESSION['session_name_here']));

//timestamp here

 

?>

what im trying to do is when the players health goes below 99 it will start going back up like mccodes

but i cant seem to get it right

Link to comment
Share on other sites

You have said $health == 100;

Therefore $health is ALWAYS going to be 100 no matter who runs the file.

You have to make it user specific by using a WHERE statement in the mysql query, or using selecting the 'health' value from the db for the user.

Link to comment
Share on other sites

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.   Paste as plain text instead

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