- if(!$this->link) $this->connect($this->host, $this->base, $this->user, $this->password);
- $sql = "SHOW COLUMNS FROM `".$table_name."` LIKE ".$field_name;
- $rst = $this->query($sql);
- $exists = false;
- $v_rst = $this->fetch_assoc($rst);
- if($v_rst) $exists = true;
- $this->free_result($rst);
- return $exists;
+ if(!$this->link) $this->connect($this->host, $this->base, $this->user, $this->password);\r
+ if(!($desc = $this->desc_table($table_name))){
+ throw new Exception($this->exception_out("Impossible de lire la description de la table"));
+ }
+ $EXISTS = false;
+ foreach($desc["attributs"] as $attribut_name => $attribut){
+ if($field_name == $attribut_name){
+ $EXISTS = true;
+ break;
+ }
+ }
+ return $EXISTS;