6,7 → 6,7 |
private $base_de_donnees = GTT_BDD_NOM; |
protected $table_nom; |
protected $correspondance; |
|
|
/*** Accesseurs : */ |
|
// Base De Donnees |
121,10 → 121,12 |
// Remplacement dans la requete par les valeurs des paramĂȘtres |
$requete = strtr($requete, $parametres); |
} |
if (GTT_DEBOGAGE) { |
if (GTT_DEBOGAGE_SQL) { |
trigger_error($requete, E_USER_NOTICE); |
} |
$tps = microtime(true); |
$resultat = $GLOBALS['db']->query($requete); |
$GLOBALS['_GTT_']['chrono']->setTempsSql($tps, microtime(true)); |
(DB::isError($resultat)) ? trigger_error(GestionnaireErreur::retournerErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete), E_USER_ERROR) : '' ; |
$tab_resultat = array(); |
while ($donnees =& $resultat->fetchRow(DB_FETCHMODE_ASSOC)) { |
160,9 → 162,12 |
'( '.$sql_attributs.' ) '. |
'VALUES '. |
'( '.$sql_valeurs.' )'; |
trigger_error($requete, E_USER_NOTICE); |
if (GTT_DEBOGAGE_SQL) { |
trigger_error($requete, E_USER_NOTICE); |
} |
$tps = microtime(true); |
$resultat = $GLOBALS['db']->query($requete); |
|
$GLOBALS['_GTT_']['chrono']->setTempsSql($tps, microtime(true)); |
(DB::isError($resultat)) ? die (GestionnaireErreur::retournerErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ; |
$nbre_enregistrement_ajoute = $GLOBALS['db']->affectedRows(); |
if ($nbre_enregistrement_ajoute == 1) { |
202,9 → 207,12 |
$sql_set = trim($sql_set, ', ').' '; |
$sql_where = trim($sql_where, ' AND ').' '; |
$requete = 'UPDATE '.$this->getBaseDeDonnees().'.'.$this->getTableNom().' SET '.$sql_set.'WHERE '.$sql_where; |
trigger_error($requete, E_USER_NOTICE); |
if (GTT_DEBOGAGE_SQL) { |
trigger_error($requete, E_USER_NOTICE); |
} |
$tps = microtime(true); |
$resultat = $GLOBALS['db']->query($requete); |
|
$GLOBALS['_GTT_']['chrono']->setTempsSql($tps, microtime(true)); |
(DB::isError($resultat)) ? die (GestionnaireErreur::retournerErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ; |
$nbre_enregistrement_ajoute = $GLOBALS['db']->affectedRows(); |
if ($nbre_enregistrement_ajoute == 1) { |
232,8 → 240,12 |
} |
$sql_where = trim($sql_where, ' AND ').' '; |
$requete = 'DELETE FROM '.$this->getBaseDeDonnees().'.'.$this->getTableNom().' WHERE '.$sql_where ; |
trigger_error($requete, E_USER_NOTICE); |
if (GTT_DEBOGAGE_SQL) { |
trigger_error($requete, E_USER_NOTICE); |
} |
$tps = microtime(true); |
$resultat = $GLOBALS['db']->query($requete); |
$GLOBALS['_GTT_']['chrono']->setTempsSql($tps, microtime(true)); |
(DB::isError($resultat)) ? die (GestionnaireErreur::retournerErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ; |
|
$nbre_enregistrement_suppr = $GLOBALS['db']->affectedRows(); |
248,7 → 260,7 |
public function initialiser() |
{ |
foreach ($this->getCorrespondance() as $champ => $attribut) { |
$methode = $this->donnerMethodeGetAvecAttribut($attribut); |
$methode = $this->donnerMethodeSetAvecAttribut($attribut); |
$this->$methode(null); |
} |
} |