The system prompts the undefined variable about the code of the course to be deselected. After the course is rejected and submitted, the system prompts an error. There are undefined variables "xuehao" & nbsp in lines 15th, 35, and 38. how can I modify them? & Lt ;! DOCTYPE & nbsp; html & nbsp; PUBLIC & nbsp;-W3CDTD & nbsp; XHTML & nbsp; 1.0 & nbsp; TransitionalEN & nbsp; the system prompts undefined variables for the code of course selection.
After the course is rejected and submitted, the system prompts an error. lines 15th, 35, and 38 have undefined variable "xuehao". how can I modify it?
Unselect subject
// ####################### Project return page 3 ############ ##############
Include "config. php ";
Include "header. php";?>
Extract ($ _ POST );
$ Query = "select * from $ student_table where xuehao = '". $ xuehao ."'";
Mysql_query ("set names 'gb2312 '");
$ Result = mysql_query ($ query );
$ Row = mysql_fetch_array ($ result );
$ Id = $ row ['id'];
$ Query1 = "select number as sn, surplus as ssn from $ jiaoshi_table where id = '$ ID '";
Mysql_query ("set names 'gb2312 '");
$ Result1 = mysql_query ($ query1 );
$ Row1 = mysql_fetch_array ($ result1 );
If ($ row1 ['SN '] = 1)
{
$ Query2 = mysql_query ("update $ jiaoshi_table set xuehao = 'unselected 'Where id =' $ ID '");
$ Query3 = mysql_query ("update $ jiaoshi_table set surplus = surplus + 1 where id = '$ ID '");
}
Else
{
If ($ row1 ['SN ']-$ row1 ['SSN']) = 1)
$ Query7 = mysql_query ("update $ jiaoshi_table set xuehao = 'unselected 'Where id =' $ ID '");
Else
$ Query6 = mysql_query ("update $ jiaoshi_table set xuehao = replace (xuehao, concat ('". $ xuehao. "',' \ n'),'') where id = '$ ID '");
$ Query8 = mysql_query ("update $ jiaoshi_table set surplus = surplus + 1 where id = '$ ID '");
$ Query5 = "update $ student_table set id = 0 where xuehao = '". $ xuehao ."'";
Mysql_query ("set names 'gb2312 '");
$ Result5 = mysql_query ($ query5 );
If ($ result5 = true)
{
Echo"The selected topic is rejected!";
Echo"
";
Exit;
}
Else
{
Echo"
An error occurred while unselecting. please return and reselect
";
Echo"
";
Exit;
}
}
?>
Share:
------ Solution --------------------
How did you change the code.
------ Solution --------------------