Php queries database tables

Source: Internet
Author: User
Php query database table problems & lt ;! DOCTYPE & nbsp; html & nbsp; PUBLIC & nbsp;-W3CDTD & nbsp; XHTML & nbsp; 1.0 & nbsp; TransitionalEN & nbsp; www. w3.orgTRxhtml1DTDxhtml1-transitional. dtd & gt; & lt; h php queries database tables




Student question query




// ####################### Student query the selected subject ############ ##############
Include "config. php ";
Include "header. php";?>
If ($ search)
{
If ($ xuehao = "")
{
Echo"

Enter your student ID!

";
Echo" ";
Exit;
}

$ Query = "select * from $ student_table where xuehao = '$ xuehao '";
Mysql_query ("set names 'gb2312 '");
$ Result = mysql_query ($ query );
$ Row = mysql_fetch_array ($ result );
If ($ row = 0)
{
Echo"

You have not registered, or your input is incorrect. please enter it again!

";
Echo" ";
Exit;
}

$ Query = "select id as sm from $ student_table where xuehao = '$ xuehao '";
Mysql_query ("set names 'gb2312 '");
$ Result = mysql_query ($ query );
$ Row = mysql_fetch_array ($ result );
If ($ row [sm] = 0)
{
Echo"

You have not selected a topic. Please select a topic!

";
Echo" ";
Exit;
}
?>









$ N = 0;$ Query = mysql_query ("select * from $ jiaoshi_table, $ student_table where $ jiaoshi_table.id = $ student_table.id and $ student_table.xuehao = '$ xuehao '");


Student ID




Student Name



Topic Name


Instructor



Title

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.