The project table contains three Pnumber Topic summary fields, I want to click the Topic hyperlink after sorting by Pnumber on a page to enter the second page and output the content in the summary field. However, the message will always be displayed when you click the next page.
Parse error: syntax error, unexpected ''(T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C: \ xampp \ htdocs \ final \ page2.PHP on line 8
How should I change my teaching requirements?
// Page1.php
$ Link = mysql_connect ("localhost", "root ","");
Mysql_select_db ("final ");
Mysql_query ("set names gb2312 ");
$ Row = mysql_query ("SELECT * FROM project order by 'pnumber' ASC ");
Echo"
";Echo"
| No. |
Question |
";While ($ rs = mysql_fetch_array ($ row )){ Echo'';Echo"
| $ Rs [Pnumber] | ";Echo"
";
Echo ''. $ rs ['topic '].'';
Echo" |
";Echo"
";
}
?>
// Page2.php
$ Link = mysql_connect ("localhost", "root ","");
Mysql_select_db ("final ");
Mysql_query ("set names gb2312 ");
$ Pnumber = $ _ POST ['pnumber'];
$ A = "select * from 'project' where 'pnumber' = '$ pnumber '";
$ Row = mysql_query ($ );
Echo "$ rs ['summary ']";
?>
Reply to discussion (solution)
Echo "$ rs ['summary ']"; -- the error is returned.
However, you have written an error in some areas. The correction is as follows:
$ A = "select * from 'project' where Pnumber = '$ pnumber'"; // either side of the Pnumber field is not enclosed by a quotation mark (') or is not added
$ Row = mysql_query ($ );
$ Rs = mysql_fetch_assoc ($ row); // you can leave it empty.
Echo $ rs ['summary '];
The code itself is correct!
It is estimated that some unprintable characters are at work.
Because there is no replacement for you, I will only
Warning: mysql_fetch_array () expects parameter 1 to be resource, boolean given in D: \ AMP \ web \ ide_tmp.php on line 8
Only indicates that the query failed.
Echo "$ rs ['summary ']"; -- the error is returned.
However, you have written an error in some areas. The correction is as follows:
$ A = "select * from 'project' where Pnumber = '$ pnumber'"; // either side of the Pnumber field is not enclosed by a quotation mark (') or is not added
$ Row = mysql_query ($ );
$ Rs = mysql_fetch_assoc ($ row); // you can leave it empty.
Echo $ rs ['summary '];
Well, I made some changes on this basis and finally succeeded. thank you ~~~