Tino
-
Posts
5 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Downloads
Gallery
Store
Posts posted by Tino
-
-
You're welcome
-
Contacting your host is probably your best bet here.
-
You can make that code a lot easier. Also, it's best practice to store your queries in variables.
$con = mysql_connect("localhost","root",""); if (!$con){ die('Could not connect: ' . mysql_error()); } mysql_select_db("stats", $con) or die(mysql_error()); if ($score_compare[1] == $score_compare[2]) { $query = "INSERT INTO `standings` (draw,team1,team2) VALUES ('".$draw."','".$team."','".$team2."')"; $result = mysql_query($query) or die(mysql_error()); } elseif ($score_compare[1] > $score_compare[2]) { $query = "INSERT INTO `standings` (wins,team1,loss,team2) VALUES ('".$wins."','".$team."','".$loss."','".$team2."')";/ $result = mysql_query($query) or die(mysql_error()); } else { if ($score_compare[1] < $score_compare[2]) { $query = "INSERT INTO `standings` (loss,team1,wins,team2) VALUES ('".$loss."','".$team."','".$wins."','".$team2."')"; $result = mysql_query($query) or die(mysql_error()); } mysql_close($con); }
-
If I'm correct, you can't have whitespace like that in HTML forms, which means you would have to use name="loss" instead of name = "loss".
Aside of that, I'd put everything you have after the if condition inside the code block of the if statement, rather than just the connection.
Newb needing assistance
in PHP
Posted
Of course. Simply replace all the if, elseif, else, etc stuff with the required switch syntax