I am working on a small PHP website. I need a MySql database access class that is easy to configure and work with.
Does not need to be a full framework, I only need a ma
ADODb is pretty easy to work with and worth considering. Some illustrative samples:
//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");