tags:

views:

51

answers:

1

I'm running this via PHP and well the first query gets run perfectly then right after it I run the second query and it does nothing. Its rows never get updated for some reason, but when I type out the query manually on the sql server, it works perfectly.

Anyone have any idea why its not working in the php code?

$qry = "UPDATE Matches SET winner ='$winner' WHERE TOURN_KEY = '$tournKey'AND MATCH_KEY='$matchKey' ";

$result = @mysql_query($qry);

$qryPoints = "UPDATE members, MemberBets SET members.points = members.points + MemberBets.amountBet + MemberBets.amountBet WHERE members.member_id=MemberBets.member_id and MemberBets.MATCH_KEY ='$matchKey' and MemberBets.TOURN_KEY = '$tournyKey' and MemberBets.player = '$winner'";

$resultPoints = @mysql_query($qryPoints);
+2  A: 

You appear to have a typo. You have a $tournKey variable in the first query and a $tournyKey variable in the second. Since you say the first query works, I'm guessing the second variable name is wrong.

Ian
lol i guess this is what i get for trying to code late at night dead tired... I need sleepThanks so much man would have never spotted that today
bob