Asf_Db_Adapter_Mysql Connecting to MySQL databases
在开启命名空间情况下(asf.use_namespace=1)类名为 Asf\Db\Adapter\Mysql
<?php final class Asf_Db_Adapter_Mysql extends Asf_Db_AbstractAdapter { protected $_type = 'mysql'; }
<?php
$configs = array(
'dsn' => array('host' => '127.0.0.1', 'dbname' => 'test', 'port' => 6666),
'username' => 'test',
'password' => 'AbcdefRDvgedf',
);
$mysql = new Asf_Db_Adapter_Mysql($configs);
<?php $mysql = new Asf_Db_Adapter_Mysql($configs); print_r($mysql);
<?php
$mysql = new Asf_Db_Adapter_Mysql($configs);
$mysql->findOne("SELECT * FROM table where id = 1");
<?php
$mysql = new Asf_Db_Adapter_Mysql($configs);
$dbh = $mysql->prepare("SELECT * FROM table where id = 1");
print_r($dbh->debugDumpParams());
<?php Asf_Db::init($configs);
<?php Asf_Db::initMySQL($configs)