You are here

public function FrxPDO::searchTableColumns in Forena Reports 8

Overrides DriverBase::searchTableColumns

File

src/FrxPlugin/Driver/FrxPDO.php, line 267
General database engine used to do sql queries.

Class

FrxPDO
Class FrxPDO

Namespace

Drupal\forena\FrxPlugin\Driver

Code

public function searchTableColumns($table, $str) {
  $str .= '%';
  $sql = $this
    ->searchTableColumnsSQL();
  $info = $this
    ->parseConnectionStr();
  $database = isset($info['dbname']) ? $info['dbname'] : @$info['database'];
  if ($sql) {
    $st = $this->db
      ->prepare($sql);
    if ($st) {
      $st
        ->execute(array(
        ':table' => $table,
        ':database' => $database,
        ':str' => $str,
      ));
    }
    if ($st) {
      return $st
        ->fetchAll(\PDO::FETCH_COLUMN, 0);
    }
    else {
      return NULL;
    }
  }
  else {
    return NULL;
  }
}