Questions about the php bulletin board

Source: Internet
Author: User
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


















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" ";Echo" ";Echo" ";}Mysql_close ($ db );?>
Serial Number Announcement title Time
";
Echo $ rows ['n' _ id'];
Echo"
";
Echo $ rows ['n' _ title'];
Echo"
";
Echo $ rows ['n' _ time'];
Echo"

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']";
?>

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.