Hello All,
Here's my delimna, I am trying to keep a running total of 1 value while maintaining a weekly value of others...this is what I am trying to do....
[PHP]//Update/Insert total wins to seperate database
$sel4="select *from Standings where user_name='$_SESSION[user_name]'";
$result4=mysql_query($sel4);
$num4 = mysql_num_rows($result4);
if ($num4 != 0)
{
$up="UPDATE Standings set user_name='$row[user_name]', Winner='$Winner', Losses='$Losses', Ties='$Ties', TotalWins='$TotalWIns' + '$Winner' where user_name='$row[user_name]'";
if (!mysql_query($up))
{
die('Error: ' . mysql_error());
}
}
else
{
$sql4="INSERT INTO Standings ( user_name, Winner, Losses, Ties, TotalWins)
VALUES
('$row[user_name]','$Winnner','$Losses','$Ties','$TotalWins' + '$Winner')";
if (!mysql_query($sql4))
{
die('Error: ' . mysql_error());
}
{
echo "$Winner";
}
}
} [/PHP]
I am trying to insert/update $Winner(wins for the week), $Losses(Losses for the week), $Ties(ties for the Week) and then Total Wins as a total where it recalls the Total Wins stored from previous week and adds it to the current week wins.
What I get stores is is correct for the Wins, Losses, Ties, but the Total Wins keeps coming up as Wins...and not a "running total"... anyone see where I am going wrong?
Any help would be great,
Patsman77