I have this script as a cron job set to run every 5 mins, the problem is it will not increment the energy level as I believe it should. If anyone can tell me what I am doing wrong here it would be great. Remember, this returns no errors, just doesn't work, also the database connect info is all correct, just left out of the post.
{
$energy = mysql_query("SELECT energy FROM members WHERE id=$id");
//get current users energy level
$energy_max = mysql_query("SELECT energy-Max FROM members WHERE id=$id");
//get current users Maximum energy level
if ($energy < $energy_max)
// do -if current energy level is less than maximum
{
$energy = $energy ++;
//increment energy by 1
mysql_query("UPDATE members SET energy= $energy");
//set the new energy level
}
$id++;
//increment to the next user
}