im making a custome game and trying to get a turn based wealth added to the account here is my code for my config.php which all my varibles are stored on
<?php
if (isset($_SESSION['user']))
{
$user = $_SESSION['user'];
$userstats="SELECT * from UserDetails where userName='$user'";
$userstats2=mysql_query($userstats) or die("Could not get user stats");
$userstats3=mysql_fetch_array($userstats2);
$networth1 = $userstats3[networth];
$email = $userstats3[e_mail];
$compname = $userstats3[company_name];
$id = $userstats3[ID];
$discustomers = $userstats3[dis_cust];
$hapcustomers = $userstats3[happy_cust];
$employee = $userstats3[employee];
$money = $userstats3[money];
$ecar = $userstats3[ecars];
$scar = $userstats3[scars];
$lcar = $userstats3[lcars];
$customers = $discustomers + $hapcustomers;
$tcar = $ecar + $scar + $lcar;
$net = $employee * 1000;
$networth = $networth1 + $net;
$wealth = $employee*500;
}
?>
then here is my cron.php page
<?php
session_start();
include"connect.php";
include"config.php";
$zip=$money+$wealth;
$well="UPDATE UserDetails SET money='$zip' WHERE active='1'";
mysql_query($well) or die();
?>
my cron is working on time but it is always setting my money to $0 even when i started out with $money=5000 and $employee=2 so i cant figure out why it sets it to 0 everytime the cron is ran