我有来自 ajax 调用的 PHP 变量。但是,当他们通过 if 语句和 while 循环时,它们是未定义的,我该如何解决这个问题。我什么都做不了。
$userID = $_POST['id'];
$clubID = $_POST['clubID'];
$type = $_POST['type'];
$delAtt = $_POST['delAtt'];
其余代码
if($delAtt == 1)
{
$result = mysql_query('SELECT * FROM events WHERE clubID = "'.$clubID.'"');
while ($row == mysql_fetch_assoc($result))
{
$eventID = $row['eventID'];
echo $eventID;
mysql_query('DELETE FROM eventmember WHERE userID = "'.$userID.'" AND eventID = "'.$eventID.'"');
mysql_query('DELETE FROM eventmember2 WHERE userID = "'.$userID.'" AND eventID = "'.$eventID.'"');
mysql_query('DELETE FROM eventmember3 WHERE userID = "'.$userID.'" AND eventID = "'.$eventID.'"');
mysql_query('DELETE FROM attendance WHERE userID = "'.$userID.'" AND eventID = "'.$eventID.'"');
mysql_query('DELETE FROM attendance2 WHERE userID = "'.$userID.'" AND eventID = "'.$eventID.'"');
mysql_query('DELETE FROM attendance3 WHERE userID = "'.$userID.'" AND eventID = "'.$eventID.'"');
}
}
所有变量都在 if 语句内工作,但不在 while 循环内