1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
/***constructeur ****/
if (isset ($config['DRIVEROPTION'])) {
$this->driverOption = $config['driverOption'];
$this->DAOobject = new PDO($this->getDns(), $this->login, $this->password, $this->driverOption);
} else {
$this->DAOobject = new PDO($this->getDns(), $this->login, $this->password);
}
if(! ($this->DAOobject instanceof PDO ) ){
print_r( PDO::errorInfo() );
}
/***methode doQuery ***/
public final function doQuery( $AliasQuery, array $tabParam = null) {
$query = $this->getQuery( $AliasQuery );
if ( is_null(($query)) ) {
//throw new DAOException('Requete indefinie pour l\'alias '.$AliasQuery);
trigger_error('Requete indefinie pour l\'alias '.$AliasQuery, E_USER_ERROR);
return false;
} else {
$sth = $this->DAOobject->prepare( $query );
echo var_dump( $this->DAOobject );
echo var_dump( $sth );
/*if( !( $sth instanceof PDOStatement)){
echo PDOStatement::errorInfo();
}*/
/***utilsation ***/
$config= array(
'SERVEUR' => 'linux027',
'USER' => 'framework',
'PASS' => 'fsreacmueewdoirtko',
'BASE' => 'framework',
//'BASE' => 'framework_test',
'TYPE' => 'mysql',
'REQUETE' => 'basemetiers',
'DEBUG' => 0,
'TYPERESULT' => 'ASSOC'
);
$pdo = new DAO( $config );
$pdo->setAttribute( 'ERRMODE_WARNING' );
$pdo->doQuery('hello');
/** la requete SELECT * FROM E_ACTIONFILTER ***/ |
Partager