i made a rating system, however each time i would click on like for the first name, it counts the vote for the second name, and when click on the like for the second name, it still counts the vote for the second name. please help.
<?php
include 'connection/connection.php';
$selection = "SELECT * FROM testrating";
$result = mysql_query($selection);
while($row=mysql_fetch_array($result))
{
$id = $row['ID'];
echo $row['name']." ".$row['name_votes']."<a href=\"index.php?id=$id\">like</a>";
$enterrating = "UPDATE testrating SET name_votes=name_votes +1 WHERE ID = \"$id\" ";
}
?>
<?php
mysql_query($enterrating);
?>