For the code to opt out, the system hints that no variables are defined

Source: Internet
Author: User
For the code to opt out of the course, the system prompts that no variables are defined.
After the withdrawal of the course submitted, the system prompts the error, 15th, 35, 38 lines have undefined variable "Xuehao" How should I modify?




<title>Retired Project</title>



##################### #退选课题界面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 '];

$query 1= "Select Number as sn,surplus as SSN from $jiaoshi _table where id= ' $id '";
mysql_query ("Set names ' GB2312 '");
$result 1=mysql_query ($query 1);
$row 1=mysql_fetch_array ($result 1);
if ($row 1[' sn ']==1)
{
$query 2=mysql_query ("Update $jiaoshi _table set xuehao= ' not selected ' where id= ' $id '");
$query 3=mysql_query ("Update $jiaoshi _table set surplus=surplus+1 where id= ' $id '");
}
Else
{
if ($row 1[' sn '-$row 1[' ssn ']) ==1)
$query 7=mysql_query ("Update $jiaoshi _table set xuehao= ' not selected ' where id= ' $id '");
Else
$query 6=mysql_query ("Update $jiaoshi _table set Xuehao=replace (Xuehao,concat ('". $xuehao. "', ' \ n '), ') where id= ' $id '" );
$query 8=mysql_query ("Update $jiaoshi _table set surplus=surplus+1 where id= ' $id '");

$query 5= "Update $student _table set id=0 where xuehao= '". $xuehao. "'";
mysql_query ("Set names ' GB2312 '");
$result 5=mysql_query ($query 5);
if ($result 5==true)
{
Echo

Exit Project Success! ";
echo " ";
Exit
}
Else
{
Echo

Return to the wrong, please go back to the election

";
echo " ";
Exit
}
}

?>


Share to:


------Solution--------------------
How do you change, after the change of the code sent out to see.
------Solution--------------------
  • Related Article

    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.