Php prompt Bar & lt; tableborder = & quot; 1 & quot; & gt; & lt; tr & gt; & lt; thwidth = & quot; 80px & quot; & gt; no. & lt;/th & gt; & lt; thwidth = & quot; 500px & quot; & gt; announcement Title & lt;/th & gt; & php notice bar
Serial Number |
Announcement title |
Time |
Include ("../control/config. php ");$ Result = mysql_query ("select * from NOTICE as n order by n. N_TIME desc limit 5 ");While ($ rows = mysql_fetch_array ($ result )){Echo"
";Echo"
"; Echo $ rows ['n' _ id']; Echo" | ";Echo"
"; Echo $ rows ['n' _ title']; Echo" | ";Echo"
"; Echo $ rows ['n' _ time']; Echo" | ";Echo"
";}Mysql_close ($ db );?>
When I click the topic (N_title) on the webpage, a page is displayed. Display theme content or something.
When you click a topic, how does one automatically generate a new interface display?
------ Solution --------------------
Create a page. Query and display the record.
------ Solution --------------------
Echo "$ rows [N_TITLE]";
View. php
Include ("../control/config. php ");
$ Result = mysql_query ("select * from NOTICE as n where N_ID = $ _ GET [id]");
$ Rows = mysql_fetch_array ($ result );
// Output $ rows code
------ Solution --------------------
Your title is read from the database, so you read the title, also read the article id, included in the link to pass
The link to the title is view. php? Id =
In this way, you can pass an article id parameter to the view. php page.
This is the view. php page.
If (empty ($ _ GET ['id'])
Exit ('no document id is specified );
// Read the article based on the input id.
$ SQL = "SELECT * FROM 'post' WHERE id = $ _ GET ['id']";
?>