I use this script to add a vote to a votecount in my database. i want it to add a vote each time the link to the particular song is clicked. (So each disticint song has its own votecount) The problem seems to be that when you click on the vote link several times it doesn't keep adding a new vote to the total. Can anyone tell me why? Thanks!
PHP Code:if (isset($_GET['vote']))
{
$votedsong=$_GET['vote'];
$getvotecountq=mysql_query("SELECT weekvotecount, yearvotecount FROM songs WHERE memberid = '$id'");
while($gvc=mysql_fetch_array($getvotecountq))
{$weekvotecount=$gvc['weekvotecount'];
$yearvotecount=$gvc['yearvotecount'];
$week=$weekvotecount + 1;
$year=$yearvotecount + 1;
$addvote=mysql_query("UPDATE songs SET weekvotecount= '$week', yearvotecount= '$year' WHERE memberid = '$id' AND songname= '$votedsong'") or die(mysql_error());
}}




Bookmarks