Chris Perk
2011-12-20 14:16:25 UTC
// reference up first tier
$query = mysql_query("SELECT reference FROM members WHERE username='$username'");
$numrows9 = mysql_num_rows($query);
if ($numrows9 == 1){
$sqlcommand ="SELECT * FROM members WHERE username = '$username' LIMIT 1";
$query = mysql_query($sqlcommand) or die (mysql_error());
while ($row = mysql_fetch_array($query)) {
$ref9 = $row ["ref"];
}
$sqlcommand ="SELECT * FROM members WHERE username = '$ref9' LIMIT 1";
$query = mysql_query($sqlcommand) or die (mysql_error());
while ($row = mysql_fetch_array($query)) {
$money9 = $row["money"];
$income9 = 5 * 0.2;
$newmoney9 = $money9 + $income9;
}
mysql_query("UPDATE members SET money='$newmoney9', tier1= '$income9' WHERE username = '$ref9' LIMIT 1");
//reference up second tier
...
Part 2 - I can separated the nested if statements into 8 separate files on my database and simply have one master script that requests them. Is this faster for the server than simply accessing one large file?
BEST ANSWER GETS 10 POINTS!