这是我的一些代码:
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());
}
现在,我的问题是,当我赞成/反对某件事时,它会在所有帖子上添加/删除 1 个评分,而不仅仅是您要评分的那个。您如何使选票独一无二或其他什么