随笔分类 -  php

摘要:分类是每个网站必不可少的表的,本次讲的分类设计,并不是无限分类是根据自己的需求可以设置分类的嵌套层数。并且支持一条sql读取属于某个分类的所有子分类首先看看表的设计:create table category ( id smallint(10) not null auto_increment primary key, name varchar(50) not null, depath tinyint(1) default 0, prefix binary(16) not null, #此处是关键,后面说明 description varchar(100) not null def... 阅读全文
posted @ 2013-10-30 14:56 Educk 阅读(462) 评论(0) 推荐(0)
摘要:参考地址:http://www.cnblogs.com/xingd/archive/2008/01/23/1050443.html稍加修改的,替换全最后出现的关键字 "repalceStr"); **/ public function __construct($str, array $keys) { $this->keys = $keys; $this->str = $str; $this->firstKey = array(); $this->dkeys = array(); $this->checkK... 阅读全文
posted @ 2013-10-21 11:58 Educk 阅读(1557) 评论(0) 推荐(0)