hi,
i wrote a pointsystem for a league,
everything is working good untill i do a certain math action
this is the piece of code where it goes wrong
$playerkills = '0';
$playerdeaths = '0';
$players3=mysql_query("SELECT playerid,matchid,roundid,kills,deaths FROM ffa_results WHERE playerid='$playeridcheck' and matchid='$matchidcheck'");
while(list($playerid3,$matchid,$roundid,$kills,$deaths)=mysql_fetch_row($players3))
{
$playerkills = ($playerkills + $kills);
$playerdeaths = ($playerdeaths + $deaths);
}
$playerkillsdeaths = ($playerkills - $playerdeaths);
$matchtypecheck=mysql_query("SELECT type FROM ffa_matches WHERE id='$matchidcheck'");
while(list($type)=mysql_fetch_row($matchtypecheck))
{
$matchtype = $type;
}
$matchskilllvlchecker=mysql_query("SELECT skill FROM ffa_matches WHERE id='$matchidcheck'");
while(list($skill)=mysql_fetch_row($matchskilllvlchecker))
{
$matchskill = $skill;
}
$skilllvlchecker=mysql_query("SELECT ffapoints FROM members WHERE id='$playeridcheck'");
while(list($skill2)=mysql_fetch_row($skilllvlchecker))
{
$playerskill = $skill2;
}
$schaal = round(($playerskill - $matchskill)*7);
$playerpoints = ($playerkillsdeaths - $schaal);
>>>>>>>>>>>>>>>>>>>>>>> $playerpoints2 = ($playerkillsdeaths - $playerpoints);
$insertSite_sql2 = "INSERT INTO ffa_points (matchid,matchtype,playerid,kills,deaths,killsdeaths,points) VALUES
($matchidcheck,$matchtype,$playeridcheck,$playerkills,$playerdeaths,$playerkillsdeaths,$playerpoints2)";
$insertSite2= mysql_query($insertSite_sql2);
}
everything works good untill the >>>>>>>> line, all math before that is working, i can insert all of those vars in the last field in the points collumn. but from the moment i do playerpoints - playerkillsdeaths it retursn me the $schaal variable, i dont have a clue why, but it does, for some kind of reason i cannot contracts those two vars ..
has this something todo with the line before the >>>> line?
who can explain this to me?
thanks allot in advance