All pastes #955273 Raw Edit

Database Abstraction

public php v1 · immutable
#955273 ·published 2008-03-24 14:52 UTC
rendered paste body
<?phpclass DataHelper{    private $dbh = null;    private $dsn = "some default connex string";    public __construct($myDsn = '') {        if (!is_empty($myDsn)) {            $this->dsn = $myDsn;        }    }    public connect() {        if (is_null($this->dbh)) {            $this->dbh = DB::connect($this->dsn);        }        if (PEAR::isError($this->dbh)) {            throw new Exception($this->dbh->getMessage());        }    }    public query($queryString, array $params = array())    {        // code    }}