_php tutorial on building a website with PHP in the Linux operating system

Source: Internet
Author: User
How to set up a news system? A complete news system not only includes the media for browsing, it also includes many features of the control and back-office management of the powerful features. So how do the sub-functions within these functions dispatch? The following is a description of the various functions of the deployment control. The realization of the news system is simple, but it can be said to be very complex.

The news system can be divided into three parts: administrator login system, news management system, user browsing system. The whole process is simple:
1, managers release News--database--Users Browse News

2. Find problems--Login management System--Edit news

The above process seems simple, but the implementation is not so simple, this is a system development, far more than the message version of the implementation of the complex, but the basic principle of operation and the same message version. In the press release system is the focus of the database planning and management system implementation.

What's in the news Now? Content: News classification, Information ontology. In a database package, these two items can be implemented in a single data table, but it is not economical, so we can use two data tables to store the content separately, one specifically stores the news classification, and the other is used to store the information ontology. How do I invoke a share that implements two-table content? Use the Table association to implement this problem (this is not the knowledge, readers can refer to the database related knowledge content, rely on their own efforts to get the most valuable knowledge, is not it?)

The following is a description of the implementation of the management feature:

1, the first is the release of the News

This is a series of submission forms together, and here are divided into two categories, creating news classification and publishing news; Create a news category and then post the relevant news in each category. It's not like this, think about all the information ontology is concentrated in a data table, how to distinguish the classification of information, The above mentioned table Association is very important here, of course, you can not use this method, to create a separate table for each classification can also solve the problem, but it is cost-effective? How about maintainability and scalability?

The related call of news classification and information ontology caused the trouble, by the way, the solution is to utilize the table Association.

2, edit, modify, delete the problem

This is the basic use of PHP (as the current mainstream development language) +mysql (and PHP collocation of the best combination) of knowledge, the realization of these functions is not difficult, there is no too much introduction, just to note that when changing or deleting a classification, how to deal with the information ontology under the classification? Because of the use of table affinity, Handling these functions is like working within a table.

3. Multi-work processing

But what happens when many people edit a piece of news at the same time? The situation is that the database will only store the last edited content, this situation will mean that the previous modification of the person's hard work is wasted, multi-power processing is to solve the problem, the approach is preconceived, that is, first into the editor has the editing authority, You only have permission to browse until the edit is complete. This feature is much like Linux permissions control, isn't it?

There are several ways to complete this feature: 1. Use cookies to control, 2. Increase the weight control field within the table. Of course, the cookie is simpler, and the way and the process of implementing cookies are:

When the administrator enters the editor, sets the cookie, the editing function of the program section to determine the value of the cookie, the blank allows editing, non-empty to reject the edit, the exit edit the cookie is emptied, so the cycle, multi-function is an effective function, at least to reduce the time and human waste.

The realization of the news browsing function is very simple, plus the paging function (this site has been introduced), a powerful news system is basically completed, it seems that a very important function, good is the search engine. Can have a strong search engine is the wish of each site, and a powerful search engine production is quite complex and difficult, it involves the efficiency, accuracy and speed and many other aspects.

The search engine described here does not involve such deep research, but is just a precise query for specific content. A complex and powerful search engine to use a lot of program and database skills, we start from a simple search engine to introduce. What is the working condition of the search engine? It receives the given keyword, then searches within the given range and returns the results of the search.
The given keyword may be anywhere in the content of the message, and how does the engine find it? In this context, the following database statements are used:


  
SELECT * FROM table where (name is like% ". $keyword."%);

Name is the exact location of the lookup, generally put field name, like% ". $keyword. "% is a pattern match, which is to find in content whether there is $keyword. Look at an example:

http://www.bkjia.com/PHPjc/508649.html www.bkjia.com true http://www.bkjia.com/PHPjc/508649.html techarticle How to set up a news system? A complete news system not only includes the media for browsing, it also includes many features of the control and back-office management of the powerful features. So these ...

  • Related Article

    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.