102,13 → 102,19 |
* @param $table : Nom de la table dont on souhaite connaitre les champs |
*/ |
public function recupererNomChamp($table) { |
$resultat = @$this->getBdd()->recupererTous('SHOW FIELDS FROM '.$table); |
if (!$resultat) { |
$requete = 'SHOW FIELDS FROM '.$table; |
$resultat = $this->getBdd()->recupererTous($requete); |
if ($resultat == '') { |
$e = 'La requête SQL formée comporte une erreur!'; |
$this->renvoyerErreur(RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE, $e); |
} elseif ($resultat) { |
foreach ($resultat as $info) { |
$this->champs_table[] = $info['Field']; |
} |
} else { |
$m = "La table recherchée n'existe pas"; |
$this->renvoyerErreur(RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE, $m); |
} |
|
foreach ($resultat as $info) $this->champs_table[] = $info['Field']; |
} |
} |
|
/** |