Here's a bit of my code:
if(isset($_GET['nyaste'])) {
$query = mysql_query("SELECT * FROM jokes ORDER BY id DESC LIMIT 0, 12") or die(mysql_error());
while ( $result = mysql_fetch_assoc($query) ) {
$id = $result["id"];
if(isset($_POST['voteup'])) {
mysql_query("UPDATE jokes SET ranking = ranking + 1 WHERE id = $id ") or die(mysql_error());
}
if(isset($_POST['votedown'])) {
mysql_query("UPDATE jokes SET ranking = ranking - 1 WHERE id = $id ") or die(mysql_error());
}
now, my problem is that when i upvote/downvote something, it adds/removes 1 rating on all the posts instead of just the one you meant to rate. How do you make the votes unique or something