高级篇中将涉及数据库的使用以及Cookie和Session会话,提升PHP的开发效率和运行效率php
PHP程序员须要掌握的MySQL操做html
链接MySQL DB:mysql
数据定义语言(DDL)linux
CREATE DATABASE [IF NO EXISTS] DatabaseName
CREATE TABLE [IF NOT EXISTS] TableName ( colname1 type [property] [index], colname2 type [property] [index], ... )[tableType] [tableCharSet];
※任何数据类型以字符串的形式存入,均可以自动转换类型程序员
※将时间保存为php时间戳,方便运算web
数据字段属性算法
索引sql
数据表类型及存储位置数据库
功能 | MyISAM | InnoDB |
事务处理 | 不支持 | 支持 |
数据行锁定 | 不支持 | 支持 |
外键约束 | 不支持 | 支持 |
表空间占用 | 相对较小 | 较大 |
全文索引 | 支持 | 不支持 |
MySQL默认字符集数组
数据操做语言(DML)
数据查询语言(DQL)
数据控制语言(DCL)
MySQL内置函数
strcmp(s1,s2):若是S1比S2小,返回-1;若是S1比S2大则返回1;若是相等则返回0(比较的是ASCII码)
PHP操做数据库
mysqli操做数据库
PDO
mamcache/memcached
基于libevent事件,因此必须先安装libevent库
Command | Description | Example |
---|---|---|
get | Reads a value | get mykey |
set | Set a key unconditionally | set mykey 0 60 5 |
add | Add a new key | add newkey 0 60 5 |
replace | Overwrite existing key | replace key 0 60 5 |
append | Append data to existing key | append key 0 60 15 |
prepend | Prepend data to existing key | prepend key 0 60 15 |
incr | Increments numerical key value by given number | incr mykey 2 |
decr | Decrements numerical key value by given number | decr mykey 5 |
delete | Deletes an existing key | delete mykey |
flush_all | Invalidate specific items immediately | flush_all |
Invalidate all items in n seconds | flush_all 900 | |
stats | Prints general statistics | stats |
Prints memory statistics | stats slabs | |
Prints memory statistics | stats malloc | |
Print higher level allocation statistics | stats items | |
stats detail | ||
stats sizes | ||
Resets statistics | stats reset | |
version | Prints server version. | version |
verbosity | Increases log level | verbosity |
quit | Terminate telnet session | quit |
PHP中使用memcache
1 <?php 2 $memcache = new Memcache; 3 $memcache->connect("localhost",11211) or die("could not connect");
会话控制:面向链接的可靠的链接方式,经过会话控制,判断用户的登陆行为
至此,PHP的基础学习算是完成了,须要多作多学,方能提升!