Php queries database tables-php Tutorial

Source: Internet
Author: User
Php queries database tables
 Student question query
  
 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 ;}?> ";} Else {echo" ";} Echo" "; $ N ++ ;}?>

Student ID

Student Name

Topic Name

Instructor

Title

". $ Row ['xuehao']."

". $ Row ['name']."

". $ Row ['subobject']."

". $ Row ['teacher']."

". $ Row ['zhicheng']."


When I enter the student ID to query, the running result is a bunch of messy things...
Note: my table name is teacher and student.


Reply to discussion (solution)

You can see the screenshot

You can see the screenshot

You can see the screenshot
Wow, the moderator personally replied. I'm excited.

You have not enabled the segment tag.
Change

You have not enabled the segment tag.
Change

You have not enabled the segment tag.
Change

You have executed all the code before line 91, so you cannot open it all.
Here is another one. you didn't change it

You have executed all the code before line 91, so you cannot open it all.
Here is another one. you didn't change it Student question query 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 ;}?> ";} Else {echo" ";} Echo" "; $ N ++ ;}?>

Student ID

Student Name

Topic Name

Instructor

Title

". $ Row ['xuehao']."

". $ Row ['name']."

". $ Row ['subobject']."

". $ Row ['teacher']."

". $ Row ['zhicheng']."

If ($ search)
{

This if is not closed, that is, the number} is missing.

If ($ search)
{

If this is not closed, it means the number} is missing. let's take a look.

If ($ search)
{

If this is not closed, that is, if the number} is missing, is it added after 48 rows? This will happen after I add it.

Is it after 48 rows?
I don't know your logic. you should be clear about it yourself.

$ Search and $ xuehao what do you define?

Is it after 48 rows?
I don't know your logic. you should be clear about it yourself.

$ Search and $ xuehao what do you define? It's not clear, because the code teacher gave me some modifications ......

A semicolon is missing.

}
Include "foot. php";?>

A semicolon is missing.

}
Include "foot. php";?> There is a semicolon.

...... The landlord looked too dizzy with this error. I suggest you check eclipse or something. There are a lot of lost things.

...... The landlord looked too dizzy with this error. I suggest you check eclipse or something. There are a lot of lost things. my last line is a syntax error. what does unexpected 'eof 'mean?


A semicolon is missing.

}
Include "foot. php";?> There is a semicolon.

The code you posted above does not contain


...... The landlord looked too dizzy with this error. I suggest you check eclipse or something. There are a lot of lost things. my last line is a syntax error. what does unexpected 'eof 'mean?

You have missing a bracket. check the code carefully.

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.