Home php教程 php手册 php进阶实现无限分类1

php进阶实现无限分类1

Jun 13, 2016 am 10:28 AM
php under Classification make exist accomplish us unlimited hour yes website Advanced

1.分析 我们在用 php 制作网站时,分类是很重要的,在分类下面又再分类这第二个分类称为次分类,而现在大多数网站分类只分到第三类: 第一分类(父分类)-->第二分类(子分类)-->第三分类(孙分类) 这种亲缘分类越多,程序和数据库的控制就越加的复杂困难.在同一级的分类处理和控制是非常的简单的,因为只需要一个数据库来记载这一级的分类就行了,如:系统,新闻等分类,在这一级上处理是很简单的,但对一个网站来说一级分类是不够的,还需要再分类,如: 系统-->linux,windows 新闻-->linux 新闻,windows 新闻 这样分类就清晰些了,至少让人明白了,系统包括 linux 和 windows,而新闻包括 linux 新闻和 windows 新闻,为了让信息资料更加清晰,于是再继续分类: linux-->系统工具,内核,编程语言,开发工具 ... 分类到了第三级,信息资料的处理就更清晰了,也就是说为了很清晰地处理资料,分类越详细就越方便,这样即方便处理信息又方便网友目的明确地查找到需要的资料,但随着不断的细化分类,在程序和数据库的控制上就会越来越困难. 困难一:如何在数据库里处理这些互有关联的亲缘分类? 困难二:如何用 php 完成这种一目了然的关系? 这种分级多而细的分类是每个 php 程序员都必须解决的问题,因为制作一个好而出色的网站分类问题是不可避免的,而解决这个问题又是相当复杂的,其中最大的问题就是数据库的分类处理,因为如果数据库处理不当将会带来巨大的工作量甚至是不得不重新规划数据库... 这并不是夸张,因为很多人在数据库处理上就会采用一级分类建立一个数据库的做法,我当时也是采取这种方法处理分类的,因大多网站都是分到第三级,所以数据库里只需三个分类数据库来进行处理.但是需要继续向下分类时,这种做法的弊端就显露出来了,因为越往下分,工作量,程序量将会巨增.. 我要介绍的这种方法就是如何用一个分类数据库建立无限向下分级的分类方法,用过 windows 的读者都知道 windows 文件夹就可以建立无限分级的目录,可在目录下面继续建立目录,这样没完没了的分下去,Linux 的目录创建也有这种功能,我介绍的这个方法跟这种形式相同.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

CakePHP Working with Database CakePHP Working with Database Sep 10, 2024 pm 05:25 PM

Working with database in CakePHP is very easy. We will understand the CRUD (Create, Read, Update, Delete) operations in this chapter.

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

To work on file upload we are going to use the form helper. Here, is an example for file upload.

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

CakePHP Creating Validators CakePHP Creating Validators Sep 10, 2024 pm 05:26 PM

Validator can be created by adding the following two lines in the controller.

CakePHP Logging CakePHP Logging Sep 10, 2024 pm 05:26 PM

Logging in CakePHP is a very easy task. You just have to use one function. You can log errors, exceptions, user activities, action taken by users, for any background process like cronjob. Logging data in CakePHP is easy. The log() function is provide

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

See all articles