Im trying to automate a poll on my site and have the results posted on a page. I have the values returning from the database but I can't seem to be able to increment the value when the vote button is pressed. What am I doing wrong in this?!
Poll---------------------
<form name="uselesspoll" action="updatepoll.php" method="get">
Street: <input type="radio" name="poll" value="0"><br>
Vert: <input type="radio" name="poll" value="1"><br>
<input type="submit" value="Vote!">
updatepoll.php--------------------------------
<?
//database name and stuff
if (!$db)
{
echo "Cannot connect to database!";
}
if ($poll == "0")
{
mysql_select_db("somedb_adrenaline-magazine_com");
$query = "Update Poll_adrenaline-magazine_com Set Street = 'sum(Street) + 1'";
$result = mysql_query($query);
if ($result)
echo "Vote entered, <a href='uselesspoll.php'>Click here</a> to go back";
}
elseif ($poll == "1")
{
mysql_select_db("somedb_adrenaline-magazine_com");
$query = "Update Poll_adrenaline-magazine_com Set Ramp = 'sum(Ramp) + 1'";
$result = mysql_query($query);
if ($result)
echo "Vote entered, <a href='uselesspoll.php'>Click here</a> to go back";
}
elseif ($poll == "")
{
Echo "Vote failed, <a href='uselesspoll.php'>Click here</a> to go back";
}
?>
Any thoughts, I'm really confused!