PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
$con = mysql_connect ('localhost', '*****', '******');
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("roondog_news", $con);
if (isset($_POST['hometeam1_score'])) {
mysql_query("UPDATE league SET played = played +1
WHERE teamname = {$_POST['hometeam1']} AND
SET played = played +1
WHERE teamname = {$_POST['hometeam2']}");
echo 'points added';
}else{
echo 'something is wrong';
}
mysql_close($con);
?>
i've put the echoes in just to see if its doing anything. it says points added but nothing is added to the database.
// Snip
mysql_query("UPDATE league SET played = played +1
WHERE teamname = {$_POST['hometeam1']} AND
SET played = played +1
WHERE teamname = {$_POST['hometeam2']}")
or die('Mysql Query Error: <br>' . mysql_error());