有人会向我解释为什么我收到一个错误,说 $new_cid 身份不明吗?仅当我使用 .= 将值附加到现有变量时才会发生这种情况。
$dereg_course_student= mysql_query("SELECT * FROM course_student");
$new_cid;
while($row=mysql_fetch_assoc($dereg_course_student)){
$cid=explode(".",$row['cid']);
foreach($cid as $cids){
if($cids==$_GET['cid']){
unset($cids);}
if(isset($cids)){
$new_cid=$new_cid.".{$cids}";}
} mysql_query("UPDATE course_student SET cid={$new_cid} WHERE sno={row['sno']}");
}