You are here

public function FrxPostgres::searchTables in Forena Reports 7.5

Method to return an array of tables that start with the string indicated in $str

Parameters

$str Name of tables.:

Return value

multitype:

Overrides FrxDataSource::searchTables

File

src/Driver/FrxPostgres.php, line 205
Postgres specific driver that takes advantage of native XML support

Class

FrxPostgres

Namespace

Drupal\forena\Driver

Code

public function searchTables($str) {
  $str .= '%';
  $db = $this->db;
  $sql = $this
    ->searchTablesSQL();
  $str = pg_escape_string($str);
  $str = "'{$str}'";
  $sql = str_replace(':str', $str, $sql);
  $rs = @pg_query($sql);
  $rownum = 0;
  $tables = array();
  if ($rs) {
    $tables = pg_fetch_all_columns($rs, 0);
  }
  if ($rs) {
    pg_free_result($rs);
  }
  return $tables;
}