예제 #1
0
파일: dao.php 프로젝트: pixxid/xengine
 /**
  * Liste les colonnes d'une table
  * @param string $tableName
  *
  * @return mixed array | null
  */
 public function listColumns($tableName)
 {
     try {
         $sql = "SHOW FIELDS FROM {$tableName}";
         $stmt = $this->dbConnection->getConn()->prepare($sql);
         if ($stmt->execute()) {
             return $stmt->fetchAll(\PDO::FETCH_NUM);
         }
     } catch (\Exception $e) {
         echo helper::error($e->getMessage() . "\r\n");
         return null;
     }
 }