我想要做的是,当有人用“一页”表决时,就算选票。 我认为,我失去了试图说明如何追踪某一成员投票的情况。 我似乎无法在某一成员表决时告诉大家。
//Generate code ID
$useXID = intval($_GET[ id ]);
$useXrank = $_GET[ rank ];
//if($useXrank!=null && $useXID!=null) {
$rankcheck = mysql_query( SELECT member_id,code_id FROM code_votes WHERE member_id=" .$_MEMBERINFO_ID. " AND WHERE code_id=" .$useXID. " );
if(!mysql_fetch_array($rankcheck) && $useXrank=="up"){
$rankset = mysql_query( SELECT * FROM code_votes WHERE member_id=" .$_MEMBERINFO_ID. " );
$ranksetfetch = mysql_fetch_array($rankset);
$rankit = htmlentities($ranksetfetch[ ranking ]);
$rankit+="1";
mysql_query("INSERT INTO code_votes (member_id,code_id) VALUES ( $_MEMBERINFO_ID , $useXID )") or die(mysql_error());
mysql_query("UPDATE code SET ranking = ".$rankit." WHERE ID = ".$useXID." ");
}
elseif(!mysql_fetch_array($rankcheck) && $useXrank=="down"){
$rankset = mysql_query( SELECT * FROM code_votes WHERE member_id=" .$_MEMBERINFO_ID. " );
$ranksetfetch = mysql_fetch_array($rankset);
$rankit = htmlentities($ranksetfetch[ ranking ]);
$rankit-="1";
mysql_query("INSERT INTO code_votes (member_id,code_id) VALUES ( $_MEMBERINFO_ID , $useXID )") or die(mysql_error());
mysql_query("UPDATE code SET ranking = ".$rankit." WHERE ID = ".$useXID." ");
}
// hide vote links since already voted
elseif(mysql_fetch_array($rankcheck)){$voted="true";}
//}