I have just been coding my Games site when i came across making the voting system
I made Vote.php:
And i have a table called 'votes' with 6 fields 5,4,3,2,1,idPHP Code:<?php
$game = $_GET['game'];
$vote = $_GET['vote'];
$sql_query = "UPDATE `votes` SET `echo $vote;` = +1 WHERE `id` = '$game'";
if(mysql_query($sql_query)) {
echo "Voted";
}
?>
So each game has a row with ID as the game id and 5,4,3,2,1 as 0 untill someone votes
but when i go on..
vote.php?game=2&vote=3
Basically: GAME=2 Is the game ID
and vote=3 Is what you vote
but when i go on it, nothing happens, when it should put the vote '3' for game id '2' up one
what can i do?





Reply With Quote



