> php教程 > php手册 > 본문

PHP设计模式汇总

WBOY
풀어 주다: 2016-06-21 08:52:57
원래의
889명이 탐색했습니다.

PHP设计模式:

PHP设计模式之装饰器模式

PHP设计模式之委托模式

PHP设计模式之外观模式

PHP设计模式之工厂模式

PHP设计模式之解释器模式

PHP设计模式之迭代器模式

PHP设计模式之中介者模式

如下为数据库脚本:

<ol class="dp-sql">
<li class="alt"><span><span>/*!40101 </span><span class="keyword">SET</span><span> NAMES utf8 */;   </span></span></li>
<li><span>   </span></li>
<li class="alt"><span>/*!40101 <span class="keyword">SET</span><span> SQL_MODE=</span><span class="string">''</span><span>*/;   </span></span></li>
<li><span>   </span></li>
<li class="alt"><span>/*!40014 <span class="keyword">SET</span><span> @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;   </span></span></li>
<li><span>/*!40014 <span class="keyword">SET</span><span> @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;   </span></span></li>
<li class="alt"><span>/*!40101 <span class="keyword">SET</span><span> @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=</span><span class="string">'NO_AUTO_VALUE_ON_ZERO'</span><span> */;   </span></span></li>
<li><span>/*!40111 <span class="keyword">SET</span><span> @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;   </span></span></li>
<li class="alt"><span>/*<span class="keyword">Table</span><span> structure </span><span class="keyword">for</span><span> </span><span class="keyword">table</span><span> `cd` */   </span></span></li>
<li><span>   </span></li>
<li class="alt"><span><span class="keyword">DROP</span><span> </span><span class="keyword">TABLE</span><span> IF EXISTS `CD`;   </span></span></li>
<li><span>   </span></li>
<li class="alt"><span><span class="keyword">CREATE</span><span> </span><span class="keyword">TABLE</span><span> `CD` (   </span></span></li>
<li><span>  `id` <span class="keyword">int</span><span>(8) </span><span class="op">NOT</span><span> </span><span class="op">NULL</span><span> AUTO_INCREMENT,   </span></span></li>
<li class="alt"><span>  `band` <span class="keyword">varchar</span><span>(500) </span><span class="keyword">COLLATE</span><span> latin1_bin </span><span class="op">NOT</span><span> </span><span class="op">NULL</span><span> </span><span class="keyword">DEFAULT</span><span> </span><span class="string">''</span><span>,   </span></span></li>
<li><span>  `title` <span class="keyword">varchar</span><span>(500) </span><span class="keyword">COLLATE</span><span> latin1_bin </span><span class="op">NOT</span><span> </span><span class="op">NULL</span><span> </span><span class="keyword">DEFAULT</span><span> </span><span class="string">''</span><span>,   </span></span></li>
<li class="alt"><span>  <span class="keyword">PRIMARY</span><span> </span><span class="keyword">KEY</span><span> (`id`)   </span></span></li>
<li><span>) ENGINE=InnoDB AUTO_INCREMENT=2 <span class="keyword">DEFAULT</span><span> CHARSET=latin1 </span><span class="keyword">COLLATE</span><span>=latin1_bin;   </span></span></li>
<li class="alt"><span>   </span></li>
<li><span>/*Data <span class="keyword">for</span><span> the </span><span class="keyword">table</span><span> `cd` */   </span></span></li>
<li class="alt"><span>   </span></li>
<li><span><span class="keyword">insert</span><span>  </span><span class="keyword">into</span><span> `CD`(`id`,`band`,`title`) </span><span class="keyword">values</span><span> (1,</span><span class="string">'Never Again'</span><span>,</span><span class="string">'Waster of a Rib'</span><span>);   </span></span></li>
<li class="alt"><span>   </span></li>
<li><span>/*<span class="keyword">Table</span><span> structure </span><span class="keyword">for</span><span> </span><span class="keyword">table</span><span> `tracks` */   </span></span></li>
<li class="alt"><span>   </span></li>
<li><span><span class="keyword">DROP</span><span> </span><span class="keyword">TABLE</span><span> IF EXISTS `tracks`;   </span></span></li>
<li class="alt"><span>   </span></li>
<li><span><span class="keyword">CREATE</span><span> </span><span class="keyword">TABLE</span><span> `tracks` (   </span></span></li>
<li class="alt"><span>  `cid` <span class="keyword">int</span><span>(8) </span><span class="keyword">DEFAULT</span><span> </span><span class="op">NULL</span><span>,   </span></span></li>
<li><span>  `tracknum` <span class="keyword">int</span><span>(8) </span><span class="keyword">DEFAULT</span><span> </span><span class="op">NULL</span><span>,   </span></span></li>
<li class="alt"><span>  `title` <span class="keyword">varchar</span><span>(500) </span><span class="keyword">COLLATE</span><span> latin1_bin </span><span class="op">NOT</span><span> </span><span class="op">NULL</span><span> </span><span class="keyword">DEFAULT</span><span> </span><span class="string">''</span><span>   </span></span></li>
<li><span>) ENGINE=InnoDB <span class="keyword">DEFAULT</span><span> CHARSET=latin1 </span><span class="keyword">COLLATE</span><span>=latin1_bin;   </span></span></li>
<li class="alt"><span>   </span></li>
<li><span>/*Data <span class="keyword">for</span><span> the </span><span class="keyword">table</span><span> `tracks` */   </span></span></li>
<li class="alt"><span>   </span></li>
<li><span><span class="keyword">insert</span><span>  </span><span class="keyword">into</span><span> `tracks`(`cid`,`tracknum`,`title`) </span><span class="keyword">values</span><span> (1,3,</span><span class="string">'What It Means'</span><span>),(1,3,</span><span class="string">'Brr'</span><span>),(1,3,</span><span class="string">'Goodbye'</span><span>);   </span></span></li>
<li class="alt"><span>   </span></li>
<li><span>/*!40101 <span class="keyword">SET</span><span> SQL_MODE=@OLD_SQL_MODE */;   </span></span></li>
<li class="alt"><span>/*!40014 <span class="keyword">SET</span><span> FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;   </span></span></li>
<li><span>/*!40014 <span class="keyword">SET</span><span> UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;   </span></span></li>
<li class="alt"><span>/*!40111 <span class="keyword">SET</span><span> SQL_NOTES=@OLD_SQL_NOTES */;   </span></span></li>
</ol>
로그인 후 복사



관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 추천
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿