Releases: caohao-go/ycdatabase
1.8-stable
修改获取单个字段的返回数组格式
v1.7-stable
减少转义临时变量内存占用
v1.6-stable
stable
V1.5
V1.4
V1.3
v1.2
v1.1
v1.0
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是强制列名为指定的大小写。