You are here

public function FrxPDO::searchTableColumns in Forena Reports 7.4

Overrides FrxDataSource::searchTableColumns

File

plugins/FrxPDO.inc, line 235
General database engine used to do sql queries.

Class

FrxPDO
@file General database engine used to do sql queries.

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);
    }
  }
}