Problem adding 1 to a mysql collumn
Posted: Thu Sep 06, 2007 8:51 am
using this code
i've put the echoes in just to see if its doing anything. it says points added but nothing is added to the database.
Code: Select all
<?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);
?>