You are here

public function FrxPostgres::searchTables in Forena Reports 7.4

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

plugins/FrxPostgres.inc, line 204
Postgres specific driver that takes advantage of native XML support

Class

FrxPostgres
@file Postgres specific driver that takes advantage of native XML support

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