| 79,7 → 79,7 |
| protected $encodage = null; |
| |
| /** Connexion à la base de données */ |
| public $connexion = null; |
| protected $connexion = null; |
| |
| /** Tableau des noms des paramètres à définir dans le fichier de config car obligatoirement nécessaire à cette classe.*/ |
| protected $parametres_obligatoires = array('bdd_abstraction', 'bdd_protocole', 'bdd_serveur', 'bdd_nom', |
| 126,7 → 126,7 |
| break; |
| default: |
| $m = "Erreur : l'abstraction '{$this->abstraction}' n'est pas prise en charge"; |
| trigger_error($m, E_USER_WARNING); |
| throw new Exception($m); |
| } |
| } |
| |
| 146,7 → 146,7 |
| $this->connexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
| } catch (PDOException $e) { |
| $e = sprintf(self::ERREUR_CONNEXION_TPL, $e->getMessage()); |
| trigger_error($e, E_USER_WARNING); |
| throw new Exception($e); |
| } |
| if ($this->encodage != null && $this->type == 'mysql') { |
| $this->connexion->query("SET names '".$this->encodage."'"); |
| 222,7 → 222,7 |
| $retour = $this->connexion->query($requete); |
| } catch (PDOException $e) { |
| $m = sprintf(self::ERREUR_REQUETE_TPL, $e->getFile(), $e->getLine(), $e->getMessage(), $requete); |
| trigger_error($m, E_USER_WARNING); |
| throw new Exception($m); |
| } |
| break; |
| case self::ABSTRACTION_MYSQL : |
| 254,7 → 254,7 |
| $retour = $this->connexion->exec($requete); |
| } catch (PDOException $e) { |
| $m = sprintf(self::ERREUR_REQUETE_TPL, $e->getFile(), $e->getLine(), $e->getMessage(), $requete); |
| trigger_error($m, E_USER_WARNING); |
| throw new Exception($m); |
| } |
| break; |
| default: |
| 290,7 → 290,7 |
| $retour = ($resultat !== false) ? $resultat->fetch($this->$mode) : $resultat; |
| } catch (PDOException $e) { |
| $m = sprintf(self::ERREUR_REQUETE_TPL, $e->getFile(), $e->getLine(), $e->getMessage(), $requete); |
| trigger_error($m, E_USER_WARNING); |
| throw new Exception($m); |
| } |
| break; |
| case self::ABSTRACTION_MYSQL : |
| 338,7 → 338,7 |
| $retour = ($resultat !== false) ? $resultat->fetchAll($this->$mode) : $resultat; |
| } catch (PDOException $e) { |
| $m = sprintf(self::ERREUR_REQUETE_TPL, $e->getFile(), $e->getLine(), $e->getMessage(), $requete); |
| trigger_error($m, E_USER_WARNING); |
| throw new Exception($m); |
| } |
| break; |
| case self::ABSTRACTION_MYSQL : |