The idea of using PHP to make news system _php Foundation
Source: Internet
Author: User
We can use the news system to store news, we can add to the news, delete and other operations, so as to reduce the workload of everyone, why not experiment.
First, create a table.
CREATE TABLE News (
n_id Int (255) NOT NULL auto_increment,
N_date datetime NOT NULL,
News text NOT NULL,
Primary KEY (N_ID)
);
The second step, set your login information
$database _user_name= "root";
$database _password= "";
$database _name= "News";
$time _offset= "0";
The third step, let us use the things in the following program as a function, save space Ah!
}
Fourth step, let's consider how to show the news
function libraries already defined above ...
The definition of the table ...
<center><font size=5 face= "' Georgia ', Verdana,arial,lucida sans,gill Sans" > $title ";
if ($admin ==1)
{
$sql = "Select Date_format (n_date, '%m/%d/%y ') as N_date, Date_format (n_date, '%h:%i ') as N_time, news, n_date as date from n EWS ORDER BY date Desc ";
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.