The lightest php database framework written in c language, built in php extension, for mysql
修改获取单个字段的返回数组格式
减少转义临时变量内存占用
stable
增加转义字符
insert 操作加上防止SQL注入
add table length to 80 character
this releases include mysql connection pool and redis pool
this releases include mysql connection pool and redis pool
The lightest php database framework written in c language, built in php extension, c database for mysql
$/path/to/phpize
$./configure --with-php-config=/path/to/php-config
$make && make install
$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是强制列名为指定的大小写。