PHP-Code:
<?
function displayerror() { echo "Klappt nicht"; }
function kontrolle($haustyp_end,$haustyp,$id)
{
if(time()>$haustyp_end && $haustyp_end!=0)
{
$result1="UPDATE buildings SET ".$haustyp."=1 WHERE dorfid='".$id."'";
mysql_query($result1) or displayerror;
} }
include("var.php");
$query1 = mysql_query("SELECT hf1_end,hf2_end,hf3_end,hf4_end,hf1,hf2,hf3,hf4,dorfid,account FROM buildings WHERE account='$id'") or displayerror();
while($row5 = mysql_fetch_array($query1))
{
kontrolle($row5[hf1_end],$row5[hf1],$row5[dorfid]);
kontrolle($row5[hf2_end],$row5[hf2],$row5[dorfid]);
kontrolle($row5[hf3_end],$row5[hf3],$row5[dorfid]);
kontrolle($row5[hf4_end],$row5[hf4],$row5[dorfid]); }
?>
Kommentar