The system prompts the undefined variable for the code of the course of rejection.

Source: Internet
Author: User
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 --------------------

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.