Increase or Decrease field using upvote and downvote buttons
<p>Novice to php / mysql:
I have a table with 2 fields (id, rating). I want to create a form with 2 buttons (upvote, downvote) that essentially update the 'rating' field of the selected id (selected at random).</p>

<p>Here is what I have been trying to make:</p>

<pre><code>&lt;form method="post"&gt;
&lt;input name="upvote" type="image" src="up.png"id="rateup" value="upvote" /&gt;
&lt;input name="downvote" type="image" src="down.png"id="ratedown" value="downvote" /&gt;
&lt;/form&gt;
&lt;?php
mysql_connect("-","-","-")or die(mysql_error());
mysql_select_db("-")or die(mysql_error());
if(isset($_POST['rateup']))
{
    $sql("UPDATE utube SET rating = rating + 1 WHERE id = '$saved_row[id]'");
}
if(isset($_POST['ratedown']))
{
    $sql("UPDATE utube SET rating = rating - 1 WHERE id = '$saved_row[id]'");
}
?&gt;
</code></pre>

<p>I am sure I am going disastrously wrong in places, I just can't find a suitable guide to doing something like this. All and any guidance is appreciated!</p>
