Jump to content
MakeWebGames

php question?


bineye

Recommended Posts

I know this isn't related to game making, but does anyone know why I can't get this to work? This is a small snippet of a league table I'm making, and trying to calculate who wins and loses from the total of goals (worth 3 points) and points (worth, well, 1 point)

 

if ((($_POST[goal1]*3) + $_POST[point1]) > (($_POST[goal2]*3) + $_POST[point2]))
{ $sql="INSERT INTO league (W, Points) VALUES ('1','2') WHERE team = $_POST['home']";
"INSERT INTO league (L, Points) VALUES ('1','0') WHERE team = $_POST['away']";	
}
Link to comment
Share on other sites

Try using this;

<?php # remove obv :P
if ((($_POST[goal1]*3) + $_POST[point1]) > (($_POST[goal2]*3) + $_POST[point2]))
{ 
$onesql = "INSERT INTO `league` (W, Points) VALUES ('1','2') WHERE `team` = ".$_POST['home']."";
$twosql = "INSERT INTO `league` (L, Points) VALUES ('1','0') WHERE `team` = ".$_POST['away']."";  
mysql_query($onesql) or die('OneSQL is broke');
mysql_query($twosql) or die('TwoSQL is broke'); 
}
?> 

Report any error's (:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...