diff --git a/src/common/db_pdo.php b/src/common/db_pdo.php index 928ea04..58d1ef4 100644 --- a/src/common/db_pdo.php +++ b/src/common/db_pdo.php @@ -84,11 +84,13 @@ abstract class DB_PDO extends PDO { */ function get_query_data($statement) { + $this->statement = $statement; + // Execute the query - $statement->execute(); + $this->statement->execute(); // Return the data array fetched - return $statement->fetchAll(PDO::FETCH_ASSOC); + return $this->statement->fetchAll(PDO::FETCH_ASSOC); } // ------------------------------------------------------------------------- @@ -101,11 +103,13 @@ abstract class DB_PDO extends PDO { */ function affected_rows($statement) { + $this->statement = $statement; + // Execute the query - $statement->execute(); + $this->statement->execute(); // Return number of rows affected - return $statement->rowCount(); + return $this->statement->rowCount; } // ------------------------------------------------------------------------- diff --git a/src/databases/pgsql.php b/src/databases/pgsql.php index e69b218..b532736 100644 --- a/src/databases/pgsql.php +++ b/src/databases/pgsql.php @@ -114,8 +114,8 @@ class pgSQL extends DB_PDO { WHERE "schemaname" NOT LIKE \'pg\_%\''; } - $sql = 'SELECT DISTINCT "schemaname" FROM pg_tables - WHERE "schemaname" NOT LIKE \'pg\_%\''; + $sql = 'SELECT "nspname" FROM pg_namespace + WHERE "nspname" NOT LIKE \'pg\_%\''; $res = $this->query($sql); $schemas = $res->fetchAll(PDO::FETCH_ASSOC); @@ -147,7 +147,7 @@ class pgSQL extends DB_PDO { */ function num_rows() { - // TODO: Implement + return (isset($this->statement)) ? $this->statement->rowCount : FALSE; } } //End of pgsql.php \ No newline at end of file