Path: chuka.playstation.co.uk!news From: "Chris Wallace" Newsgroups: scee.yaroze.freetalk.english Subject: Re: Help!!! (PHP and mySQL) Date: Wed, 20 Nov 2002 16:13:42 -0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 116 Message-ID: References: NNTP-Posting-Host: host217-35-8-203.in-addr.btopenworld.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 = $clancount)//loop for number of clans { $row = mysql_fetch_array($result); $curclan = $row["name"]; $owed = 0; $iscount = 1; while($iscount <= $islands) { $sql2="SELECT * FROM cw_island$iscount"; $result2=mysql_query($sql2,$db); $numland = mysql_num_rows($result2); $landcount = 1; while($landcount <= $numland) { $row2 = mysql_fetch_array($result2); $money = $row2["money"]; $clan = $row2["clan"]; $holy = $row2["holy"]; $attacked = $row2["attacked"]; $shrine = $row2["shrine"]; if($attacked == 2) { $sql13 = "UPDATE $table$iscount SET attacked = 0 WHERE number = '$landcount'"; $result13 = mysql_query($sql3); } if($clan == $curclan) { $owed = $owed + $money; if($holy == 1) if($shrine == 0) { $owed = $owed + $money*2; } if($holy == 1) if($shrine == 1) { $owed = $owed + $money*5; } if($holy == 1) if($shrine == 2) { $owed = $owed + $money*9; } $sql3 = "UPDATE $clantable SET money = money + $owed WHERE name='$curclan'"; $result3 = mysql_query($sql3); $sql3="SELECT * FROM $clantable WHERE name = '$curclan'"; $result3=mysql_query($sql3,$db); $row3 = mysql_fetch_array($result3); $owed = $row["money"]; $owed = 0; } $landcount++; } $iscount++; } $clancount++; $owed = 0; } //update date $sql4 = "UPDATE $misctable SET date = '$dd' WHERE id='1'"; $result4 = mysql_query($sql4); } ?>