I only know that my code is missing a curly braces} but I don't know where to fill it out. The result I want is that the student ID can be displayed normally after I enter the student ID. if necessary, I can put curly braces in any place and then run the result.
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 ;}?>
| Student ID |
Student Name |
Topic Name |
Instructor |
Title |
";} Else {echo"
";} Echo"
| ". $ Row ['xuehao']." |
". $ Row ['name']." |
". $ Row ['subobject']." |
". $ Row ['teacher']." |
". $ Row ['zhicheng']." |
"; $ N ++ ;}?>
Reply to discussion (solution)
At least the code you posted has no problem!
At least the code you posted has no problem! I add the curly braces to the 10th rows, and its display is like this.
At least the code you posted has no problem!
At least the code you posted has no problem! I add} to row 21st, and its display is like this.
However, no syntax error is reported for your code here!
Of course, it is impossible for me to execute relevant code without your database environment
However, "you have not selected a subject. please choose a topic !" Always executable
} In 32 rows, the display is as follows:
I added it to the last line.
How can we read the program first?
I am a newbie, and I am in full entry stage for php ......
However, no syntax error is reported for your code here!
Of course, it is impossible for me to execute relevant code without your database environment
However, "you have not selected a subject. please choose a topic !" I am sorry, there are still 16 lines of less important code before I show you images. If I add} to the last correct one, where should I modify it?
What's the problem at the end?
The code you posted is correct!
If 16 lines of less important code are added, the problem is that 16 lines of less important code.
However, no syntax error is reported for your code here!
Of course, it is impossible for me to execute relevant code without your database environment
However, "you have not selected a subject. please choose a topic !" I am sorry, there are still 16 lines of less important code before I show you images. If I add} to the last correct one, where should I modify it?
What's the problem at the end? In the end, it will be displayed (! ) SCREAM: Error suppression ignored
(! ) Notice: Undefined variable: search in D: \ wamp \ www \ selectsubject3 \ query1.php on line 3
Call Stack
# Time Memory Function Location
1 0.0010 149536 {main} () .. \ query1.php: 0
From http://bbs.csdn.net/topics/390451883? Page = 1 # post-394465455 # Code
$ N ++;
}
}?>
Actually missing}
Notice: Undefined variable: search
Prompt $ searche variable is defined
From http://bbs.csdn.net/topics/390451883? Page = 1 # post-394465455 # Code
$ N ++;
}
}?>
Yes, I did.} then I tried to see where to add it. Is it my database?
Notice: Undefined variable: search
The prompt $ searche variable is defined. what should I do?
$ What is search for? is it taken from the form on the previous page? Describe your business logic in detail.
In addition, the code should be fully pasted.