Db driver improvements
This commit is contained in:
parent
103d665e57
commit
3d8382149e
@ -84,11 +84,13 @@ abstract class DB_PDO extends PDO {
|
|||||||
*/
|
*/
|
||||||
function get_query_data($statement)
|
function get_query_data($statement)
|
||||||
{
|
{
|
||||||
|
$this->statement = $statement;
|
||||||
|
|
||||||
// Execute the query
|
// Execute the query
|
||||||
$statement->execute();
|
$this->statement->execute();
|
||||||
|
|
||||||
// Return the data array fetched
|
// 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)
|
function affected_rows($statement)
|
||||||
{
|
{
|
||||||
|
$this->statement = $statement;
|
||||||
|
|
||||||
// Execute the query
|
// Execute the query
|
||||||
$statement->execute();
|
$this->statement->execute();
|
||||||
|
|
||||||
// Return number of rows affected
|
// Return number of rows affected
|
||||||
return $statement->rowCount();
|
return $this->statement->rowCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
@ -114,8 +114,8 @@ class pgSQL extends DB_PDO {
|
|||||||
WHERE "schemaname" NOT LIKE \'pg\_%\'';
|
WHERE "schemaname" NOT LIKE \'pg\_%\'';
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT DISTINCT "schemaname" FROM pg_tables
|
$sql = 'SELECT "nspname" FROM pg_namespace
|
||||||
WHERE "schemaname" NOT LIKE \'pg\_%\'';
|
WHERE "nspname" NOT LIKE \'pg\_%\'';
|
||||||
|
|
||||||
$res = $this->query($sql);
|
$res = $this->query($sql);
|
||||||
$schemas = $res->fetchAll(PDO::FETCH_ASSOC);
|
$schemas = $res->fetchAll(PDO::FETCH_ASSOC);
|
||||||
@ -147,7 +147,7 @@ class pgSQL extends DB_PDO {
|
|||||||
*/
|
*/
|
||||||
function num_rows()
|
function num_rows()
|
||||||
{
|
{
|
||||||
// TODO: Implement
|
return (isset($this->statement)) ? $this->statement->rowCount : FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//End of pgsql.php
|
//End of pgsql.php
|
Reference in New Issue
Block a user