Ycdatabase Versions Save

The lightest php database framework written in c language, built in php extension, for mysql

1.8-stable

4 years ago

修改获取单个字段的返回数组格式

1.7

4 years ago

减少转义临时变量内存占用

1.6

4 years ago

stable

1.5

4 years ago

增加转义字符

1.4

4 years ago

insert 操作加上防止SQL注入

V1.3

4 years ago

add table length to 80 character

1.2

5 years ago

this releases include mysql connection pool and redis pool

1.1

5 years ago

this releases include mysql connection pool and redis pool

v1.0

5 years ago

Introduction

The lightest php database framework written in c language, built in php extension, c database for mysql

Compire ycdatabase in linux

$/path/to/phpize
$./configure --with-php-config=/path/to/php-config
$make && make install

Start ycdatabase

  • new ycdb()
$db_conf = array("host" => "127.0.0.1", 
                 "username" => "root", 
                 "password" => "test123123", 
                 "dbname" => "userinfo", 
                 "port" => '3306', 
                 "option" => array(
                        PDO::ATTR_CASE => PDO::CASE_NATURAL,
                        PDO::ATTR_TIMEOUT => 2));

$ycdb = new ycdb($db_conf);

we can start by creating a ycdatabase object (ycdb) from the obove code, db_conf include host,username,password,dbname,port and option, option is a pdo attribution, you can get the detail from http://php.net/manual/en/pdo.setattribute.php, For example, PDO::ATTR_TIMEOUT in the above code is specifies the timeout duration in seconds, and PDO::ATTR_CASE is forcing column names to a specific case.

我们通过上面代码创建ycdatabase对象(ycdb),db_conf是数据库配置,包含host,username,password,dbname,port等信息,还包含option参数,这个参数是pdo的设置参数,具体您可以参考网站 http://php.net/manual/zh/pdo.setattribute.php , 例如上面代码中的PDO::ATTR_TIMEOUT是连接超时时间(秒),PDO::ATTR_CASE是强制列名为指定的大小写。