你可以做这样的事情:
$username = $_COOKIE['username'];
$sql = "SELECT * FROM QUESTIONS WHERE username ='$username'";
$result = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($result) > 0) {
//---------- new
if(isset($_GET['voteID']))
{
$viteID = (int) $_GET['voteID'];
// your update query
}
//--------
?>
Question ID | Question | Active/Inactive |
$html = '';
while ($row = mysql_fetch_row($result)) {
$html .= '
';$html .= '
' . $row[0] . '';$html .= '
' . $row[1] . '';$activity = $row[3];
// ---- new
$html .= 'Active' . '';
} else {
$html .= '
' . 'Inactive' . '';}
$html .='
';}
echo $html;
?>
}
?>