Ger*_*orm 8 php mysql database
我正在一个小型的PHP网站上工作.我需要一个易于配置和使用的MySql数据库访问类.
不需要是一个完整的框架,我只需要一个最大的.几节课.
Pau*_*xon 10
ADODb很容易使用,值得考虑.一些说明性样本:
//connect
$dsn = 'mysql://user:pwd@localhost/mydb';
$db = ADONewConnection($dsn);
//get a single value
$value=$db->GetOne("select foo from bar where x=?", array($x));
//get a row
$row=$db->GetRow("select * from bar where x=?", array($x));
//easy insert example
$record=array("id"=>1, "foo"=>"bar");
$db->AutoExecute("table", $record, "INSERT");
Run Code Online (Sandbox Code Playgroud)