HI just wounderd why my cron has an error:
PHP Code:
<?php
//require and connect
require("connect.php");
echo "Updating Progress..........";
//connect and query buildup and get all infomation
$query = mysql_query("SELECT * FROM buildup")
or die(mysql_error());
$result = mysql_query($query);
echo "<br>Connected to database";
//do while on each result
while($row = mysql_fetch_assoc($result))
{
//start of while script
//some vairiables
$expiry = $row['endtime'];
$now = time();
$buildingtype = $row['building'];
$upgrade='bank';
//the if function on each row to update users whos buildings have finnished
if($expiry<$now){
$updateusers = mysql_query("UPDATE users SET $upgrade=$upgrade+'1' WHERE id = $row['userid']");
echo "<br><br>Updated building Successfully";
$deletelogs = mysql_query("DELETE FROM buildup WHERE $expiry < $now");
echo "<br>Deleted Expired Logs Successfully";
}
elseif($expiry>$now){
echo 'Nothing to update';
}else {
echo 'Error! Thats not good';
}
//end of while script
}
?>
the error is on this line:
PHP Code:
$updateusers = mysql_query("UPDATE users SET $upgrade=$upgrade+'1' WHERE id = $row['userid']");
please help me as my progress is on hold until this can be rectified
Bookmarks