mirror of
https://github.com/vrana/adminer.git
synced 2025-08-20 13:21:30 +02:00
Use common parent for Db
This commit is contained in:
@@ -12,8 +12,8 @@ $drivers["mssql"] = "MS SQL";
|
||||
if (isset($_GET["mssql"])) {
|
||||
define('Adminer\DRIVER', "mssql");
|
||||
if (extension_loaded("sqlsrv") && $_GET["ext"] != "pdo") {
|
||||
class Db {
|
||||
public $extension = "sqlsrv", $flavor = '', $server_info, $affected_rows, $errno, $error;
|
||||
class Db extends SqlDb {
|
||||
public $extension = "sqlsrv";
|
||||
private $link, $result;
|
||||
|
||||
private function get_error() {
|
||||
@@ -95,15 +95,6 @@ if (isset($_GET["mssql"])) {
|
||||
function next_result() {
|
||||
return $this->result ? sqlsrv_next_result($this->result) : null;
|
||||
}
|
||||
|
||||
function result($query, $field = 0) {
|
||||
$result = $this->query($query);
|
||||
if (!is_object($result)) {
|
||||
return false;
|
||||
}
|
||||
$row = $result->fetch_row();
|
||||
return $row[$field];
|
||||
}
|
||||
}
|
||||
|
||||
class Result {
|
||||
@@ -168,7 +159,7 @@ if (isset($_GET["mssql"])) {
|
||||
}
|
||||
|
||||
} else {
|
||||
class MssqlDb extends PdoDb {
|
||||
abstract class MssqlDb extends PdoDb {
|
||||
function select_db($database) {
|
||||
// database selection is separated from the connection so dbname in DSN can't be used
|
||||
return $this->query(use_sql($database));
|
||||
|
@@ -47,7 +47,7 @@ if (!defined('Adminer\DRIVER')) {
|
||||
|
||||
function result($query, $field = 0) {
|
||||
$result = $this->query($query);
|
||||
if (!$result) {
|
||||
if (!is_object($result)) {
|
||||
return false;
|
||||
}
|
||||
$row = $result->fetch_array();
|
||||
@@ -60,24 +60,9 @@ if (!defined('Adminer\DRIVER')) {
|
||||
}
|
||||
|
||||
} elseif (extension_loaded("mysql") && !((ini_bool("sql.safe_mode") || ini_bool("mysql.allow_local_infile")) && extension_loaded("pdo_mysql"))) {
|
||||
class Db {
|
||||
/** @var string */ public $extension = "MySQL"; // extension name
|
||||
/** @var string */ public $flavor = ''; // different vendor with the same API; e.g. MariaDB; usually stays empty
|
||||
/** @var string */ public $server_info; // server version
|
||||
/** @var int */ public $affected_rows; // number of affected rows
|
||||
/** @var string */ public $info; // see https://php.net/mysql_info
|
||||
/** @var int */ public $errno; // last error code
|
||||
/** @var string */ public $error; // last error message
|
||||
class Db extends SqlDb {
|
||||
/** @var resource */ private $link;
|
||||
|
||||
/** @var \mysqli */ private $link;
|
||||
/** @var Result */ private $result;
|
||||
|
||||
/** Connect to server
|
||||
* @param string
|
||||
* @param string
|
||||
* @param string
|
||||
* @return bool
|
||||
*/
|
||||
function connect($server, $username, $password) {
|
||||
if (ini_bool("mysql.allow_local_infile")) {
|
||||
$this->error = lang('Disable %s or enable %s or %s extensions.', "'mysql.allow_local_infile'", "MySQLi", "PDO_MySQL");
|
||||
@@ -113,27 +98,14 @@ if (!defined('Adminer\DRIVER')) {
|
||||
return $this->query("SET NAMES $charset");
|
||||
}
|
||||
|
||||
/** Quote string to use in SQL
|
||||
* @param string
|
||||
* @return string escaped string enclosed in '
|
||||
*/
|
||||
function quote($string) {
|
||||
return "'" . mysql_real_escape_string($string, $this->link) . "'";
|
||||
}
|
||||
|
||||
/** Select database
|
||||
* @param string
|
||||
* @return bool
|
||||
*/
|
||||
function select_db($database) {
|
||||
return mysql_select_db($database, $this->link);
|
||||
}
|
||||
|
||||
/** Send query
|
||||
* @param string
|
||||
* @param bool
|
||||
* @return Result|bool
|
||||
*/
|
||||
function query($query, $unbuffered = false) {
|
||||
$result = @($unbuffered ? mysql_unbuffered_query($query, $this->link) : mysql_query($query, $this->link)); // @ - mute mysql.trace_mode
|
||||
$this->error = "";
|
||||
@@ -149,39 +121,6 @@ if (!defined('Adminer\DRIVER')) {
|
||||
}
|
||||
return new Result($result);
|
||||
}
|
||||
|
||||
/** Send query with more resultsets
|
||||
* @param string
|
||||
* @return Result|bool
|
||||
*/
|
||||
function multi_query($query) {
|
||||
return $this->result = $this->query($query);
|
||||
}
|
||||
|
||||
/** Get current resultset
|
||||
* @return Result
|
||||
*/
|
||||
function store_result() {
|
||||
return $this->result;
|
||||
}
|
||||
|
||||
/** Fetch next resultset
|
||||
* @return bool
|
||||
*/
|
||||
function next_result() {
|
||||
// MySQL extension doesn't support multiple results
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Get single field from result
|
||||
* @param string
|
||||
* @param int
|
||||
* @return string
|
||||
*/
|
||||
function result($query, $field = 0) {
|
||||
$result = $this->query($query);
|
||||
return ($result ? $result->fetch_column($field) : false);
|
||||
}
|
||||
}
|
||||
|
||||
class Result {
|
||||
@@ -198,27 +137,19 @@ if (!defined('Adminer\DRIVER')) {
|
||||
}
|
||||
|
||||
/** Fetch next row as associative array
|
||||
* @return string[]
|
||||
* @return array<?string>
|
||||
*/
|
||||
function fetch_assoc() {
|
||||
return mysql_fetch_assoc($this->result);
|
||||
}
|
||||
|
||||
/** Fetch next row as numbered array
|
||||
* @return list<string>
|
||||
* @return list<?string>
|
||||
*/
|
||||
function fetch_row() {
|
||||
return mysql_fetch_row($this->result);
|
||||
}
|
||||
|
||||
/** Fetch a single column
|
||||
* @param int
|
||||
* @return string or false if there are no rows
|
||||
*/
|
||||
function fetch_column($field) {
|
||||
return ($this->num_rows ? mysql_result($this->result, 0, $field) : false);
|
||||
}
|
||||
|
||||
/** Fetch next field
|
||||
* @return object properties: name, type (0 number, 15 varchar, 254 char), charsetnr (63 binary); optionally: table, orgtable, orgname
|
||||
*/
|
||||
@@ -268,7 +199,7 @@ if (!defined('Adminer\DRIVER')) {
|
||||
}
|
||||
|
||||
function set_charset($charset) {
|
||||
$this->query("SET NAMES $charset"); // charset in DSN is ignored before PHP 5.3.6
|
||||
return $this->query("SET NAMES $charset"); // charset in DSN is ignored before PHP 5.3.6
|
||||
}
|
||||
|
||||
function select_db($database) {
|
||||
@@ -1179,7 +1110,7 @@ if (!defined('Adminer\DRIVER')) {
|
||||
}
|
||||
|
||||
/** Check whether a feature is supported
|
||||
* @param string "check|comment|copy|database|descidx|drop_col|dump|event|indexes|kill|materializedview|partitioning|privileges|procedure|processlist|routine|scheme|sequence|status|table|trigger|type|variables|view|view_trigger"
|
||||
* @param literal-string "check|comment|copy|database|descidx|drop_col|dump|event|indexes|kill|materializedview|partitioning|privileges|procedure|processlist|routine|scheme|sequence|status|table|trigger|type|variables|view|view_trigger"
|
||||
* @return bool
|
||||
*/
|
||||
function support($feature) {
|
||||
|
@@ -6,10 +6,10 @@ $drivers["oracle"] = "Oracle (beta)";
|
||||
if (isset($_GET["oracle"])) {
|
||||
define('Adminer\DRIVER', "oracle");
|
||||
if (extension_loaded("oci8") && $_GET["ext"] != "pdo") {
|
||||
class Db {
|
||||
public $extension = "oci8", $flavor = '', $server_info, $affected_rows, $errno, $error;
|
||||
class Db extends SqlDb {
|
||||
public $extension = "oci8";
|
||||
public $_current_db;
|
||||
private $link, $result;
|
||||
private $link;
|
||||
|
||||
function _error($errno, $error) {
|
||||
if (ini_bool("html_errors")) {
|
||||
@@ -60,23 +60,6 @@ if (isset($_GET["oracle"])) {
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function multi_query($query) {
|
||||
return $this->result = $this->query($query);
|
||||
}
|
||||
|
||||
function store_result() {
|
||||
return $this->result;
|
||||
}
|
||||
|
||||
function next_result() {
|
||||
return false;
|
||||
}
|
||||
|
||||
function result($query, $field = 0) {
|
||||
$result = $this->query($query);
|
||||
return (is_object($result) ? $result->fetch_column($field) : false);
|
||||
}
|
||||
}
|
||||
|
||||
class Result {
|
||||
@@ -104,10 +87,6 @@ if (isset($_GET["oracle"])) {
|
||||
return $this->convert(oci_fetch_row($this->result));
|
||||
}
|
||||
|
||||
function fetch_column($field) {
|
||||
return (oci_fetch($this->result) ? oci_result($this->result, $field + 1) : false);
|
||||
}
|
||||
|
||||
function fetch_field() {
|
||||
$column = $this->offset++;
|
||||
$return = new \stdClass;
|
||||
|
@@ -6,9 +6,9 @@ $drivers["pgsql"] = "PostgreSQL";
|
||||
if (isset($_GET["pgsql"])) {
|
||||
define('Adminer\DRIVER', "pgsql");
|
||||
if (extension_loaded("pgsql") && $_GET["ext"] != "pdo") {
|
||||
class Db {
|
||||
public $extension = "PgSQL", $flavor = '', $server_info, $affected_rows, $error, $timeout;
|
||||
private $link, $result, $string, $database = true;
|
||||
class Db extends SqlDb {
|
||||
public $extension = "PgSQL", $timeout;
|
||||
private $link, $string, $database = true;
|
||||
|
||||
function _error($errno, $error) {
|
||||
if (ini_bool("html_errors")) {
|
||||
@@ -86,24 +86,6 @@ if (isset($_GET["pgsql"])) {
|
||||
return $return;
|
||||
}
|
||||
|
||||
function multi_query($query) {
|
||||
return $this->result = $this->query($query);
|
||||
}
|
||||
|
||||
function store_result() {
|
||||
return $this->result;
|
||||
}
|
||||
|
||||
function next_result() {
|
||||
// PgSQL extension doesn't support multiple results
|
||||
return false;
|
||||
}
|
||||
|
||||
function result($query, $field = 0) {
|
||||
$result = $this->query($query);
|
||||
return ($result ? $result->fetch_column($field) : false);
|
||||
}
|
||||
|
||||
function warnings() {
|
||||
return h(pg_last_notice($this->link)); // second parameter is available since PHP 7.1.0
|
||||
}
|
||||
@@ -126,10 +108,6 @@ if (isset($_GET["pgsql"])) {
|
||||
return pg_fetch_row($this->result);
|
||||
}
|
||||
|
||||
function fetch_column($field) {
|
||||
return ($this->num_rows ? pg_fetch_result($this->result, 0, $field) : false);
|
||||
}
|
||||
|
||||
function fetch_field() {
|
||||
$column = $this->offset++;
|
||||
$return = new \stdClass;
|
||||
@@ -176,7 +154,9 @@ if (isset($_GET["pgsql"])) {
|
||||
return $return;
|
||||
}
|
||||
|
||||
// warnings() not implemented in PDO_PgSQL as of PHP 7.2.1
|
||||
function warnings() {
|
||||
// not implemented in PDO_PgSQL as of PHP 7.2.1
|
||||
}
|
||||
|
||||
function close() {
|
||||
}
|
||||
|
@@ -7,17 +7,18 @@ if (isset($_GET["sqlite"])) {
|
||||
define('Adminer\DRIVER', "sqlite");
|
||||
if (class_exists("SQLite3") && $_GET["ext"] != "pdo") {
|
||||
|
||||
class SqliteDb {
|
||||
public $extension = "SQLite3", $flavor = '', $server_info, $affected_rows, $errno, $error;
|
||||
private $link, $result;
|
||||
abstract class SqliteDb extends SqlDb {
|
||||
public $extension = "SQLite3";
|
||||
private $link;
|
||||
|
||||
function __construct($filename) {
|
||||
function connect($filename, $username = '', $password = '') {
|
||||
$this->link = new \SQLite3($filename);
|
||||
$version = $this->link->version();
|
||||
$this->server_info = $version["versionString"];
|
||||
return true;
|
||||
}
|
||||
|
||||
function query($query) {
|
||||
function query($query, $unbuffered = false) {
|
||||
$result = @$this->link->query($query);
|
||||
$this->error = "";
|
||||
if (!$result) {
|
||||
@@ -37,28 +38,6 @@ if (isset($_GET["sqlite"])) {
|
||||
: "x'" . first(unpack('H*', $string)) . "'"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
function multi_query($query) {
|
||||
return $this->result = $this->query($query);
|
||||
}
|
||||
|
||||
function store_result() {
|
||||
return $this->result;
|
||||
}
|
||||
|
||||
function next_result() {
|
||||
return false;
|
||||
}
|
||||
|
||||
function result($query, $field = 0) {
|
||||
$result = $this->query($query);
|
||||
if (!is_object($result)) {
|
||||
return false;
|
||||
}
|
||||
$row = $result->fetch_row();
|
||||
return $row ? $row[$field] : false;
|
||||
}
|
||||
}
|
||||
|
||||
class Result {
|
||||
@@ -93,15 +72,14 @@ if (isset($_GET["sqlite"])) {
|
||||
}
|
||||
|
||||
} elseif (extension_loaded("pdo_sqlite")) {
|
||||
class SqliteDb extends PdoDb {
|
||||
abstract class SqliteDb extends PdoDb {
|
||||
public $extension = "PDO_SQLite";
|
||||
|
||||
function __construct($filename) {
|
||||
function connect($filename, $username = '', $password = '') {
|
||||
$this->dsn(DRIVER . ":$filename", "", "");
|
||||
}
|
||||
|
||||
function select_db($db) {
|
||||
return false;
|
||||
$this->query("PRAGMA foreign_keys = 1");
|
||||
$this->query("PRAGMA busy_timeout = 500");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,17 +87,16 @@ if (isset($_GET["sqlite"])) {
|
||||
|
||||
if (class_exists('Adminer\SqliteDb')) {
|
||||
class Db extends SqliteDb {
|
||||
function __construct() {
|
||||
parent::__construct(":memory:");
|
||||
function connect($filename, $username = '', $password = '') {
|
||||
parent::connect($filename);
|
||||
$this->query("PRAGMA foreign_keys = 1");
|
||||
$this->query("PRAGMA busy_timeout = 500");
|
||||
return true;
|
||||
}
|
||||
|
||||
function select_db($filename) {
|
||||
if (is_readable($filename) && $this->query("ATTACH " . $this->quote(preg_match("~(^[/\\\\]|:)~", $filename) ? $filename : dirname($_SERVER["SCRIPT_FILENAME"]) . "/$filename") . " AS a")) { // is_readable - SQLite 3
|
||||
parent::__construct($filename);
|
||||
$this->query("PRAGMA foreign_keys = 1");
|
||||
$this->query("PRAGMA busy_timeout = 500");
|
||||
return true;
|
||||
if (is_readable($filename) && $this->query("ATTACH " . $this->quote(preg_match("~(^[/\\\\]|:)~", $filename) ? $filename : dirname($_SERVER["SCRIPT_FILENAME"]) . "/$filename") . " AS a")) {
|
||||
return self::connect($filename);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -197,7 +174,9 @@ if (isset($_GET["sqlite"])) {
|
||||
if ($password != "") {
|
||||
return lang('Database does not support password.');
|
||||
}
|
||||
return new Db;
|
||||
$connection = new Db;
|
||||
$connection->connect(":memory:", "", "");
|
||||
return $connection;
|
||||
}
|
||||
|
||||
function get_databases($flush) {
|
||||
@@ -392,7 +371,8 @@ if (isset($_GET["sqlite"])) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
$link = new SqliteDb($db);
|
||||
$link = new Db();
|
||||
$link->connect($db);
|
||||
} catch (\Exception $ex) {
|
||||
$connection->error = $ex->getMessage();
|
||||
return false;
|
||||
@@ -476,7 +456,7 @@ if (isset($_GET["sqlite"])) {
|
||||
* @param string new name
|
||||
* @param list<list<string>> [process_field()], empty to preserve
|
||||
* @param string[] [$original => idf_escape($new_column)], empty to preserve
|
||||
* @param string [format_foreign_key()], empty to preserve
|
||||
* @param string[] [format_foreign_key()], empty to preserve
|
||||
* @param int set auto_increment to this value, 0 to preserve
|
||||
* @param list<array{string, string, list<string>|'DROP'}> [[$type, $name, $columns]], empty to preserve
|
||||
* @param string CHECK constraint to drop
|
||||
|
@@ -70,6 +70,7 @@ if (function_exists("get_magic_quotes_runtime") && get_magic_quotes_runtime()) {
|
||||
|
||||
include "../adminer/include/lang.inc.php";
|
||||
include "../adminer/lang/$LANG.inc.php";
|
||||
include "../adminer/include/db.inc.php";
|
||||
include "../adminer/include/pdo.inc.php";
|
||||
include "../adminer/include/driver.inc.php";
|
||||
include "../adminer/drivers/sqlite.inc.php";
|
||||
|
78
adminer/include/db.inc.php
Normal file
78
adminer/include/db.inc.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
// this could be interface when "Db extends \mysqli" can have compatible type declarations (PHP 7)
|
||||
// interfaces can include properties only since PHP 8.4
|
||||
abstract class SqlDb {
|
||||
/** @var string */ public $extension; // extension name
|
||||
/** @var string */ public $flavor; // different vendor with the same API, e.g. MariaDB; usually stays empty
|
||||
/** @var string */ public $server_info; // server version
|
||||
/** @var int */ public $affected_rows; // number of affected rows
|
||||
/** @var string */ public $info; // see https://php.net/mysql_info
|
||||
/** @var int */ public $errno; // last error code
|
||||
/** @var string */ public $error; // last error message
|
||||
/** @var Result|bool */ protected $multi; // used for multiquery
|
||||
|
||||
/** Connect to server
|
||||
* @param string
|
||||
* @param string
|
||||
* @param string
|
||||
* @return bool
|
||||
*/
|
||||
abstract function connect($server, $username, $password);
|
||||
|
||||
/** Quote string to use in SQL
|
||||
* @param string
|
||||
* @return string escaped string enclosed in '
|
||||
*/
|
||||
abstract function quote($string);
|
||||
|
||||
/** Select database
|
||||
* @param string
|
||||
* @return bool
|
||||
*/
|
||||
abstract function select_db($database);
|
||||
|
||||
/** Send query
|
||||
* @param string
|
||||
* @param bool
|
||||
* @return Result|bool
|
||||
*/
|
||||
abstract function query($query, $unbuffered = false);
|
||||
|
||||
/** Send query with more resultsets
|
||||
* @param string
|
||||
* @return Result|bool
|
||||
*/
|
||||
function multi_query($query) {
|
||||
return $this->multi = $this->query($query);
|
||||
}
|
||||
|
||||
/** Get current resultset
|
||||
* @return Result|bool
|
||||
*/
|
||||
function store_result() {
|
||||
return $this->multi;
|
||||
}
|
||||
|
||||
/** Fetch next resultset
|
||||
* @return bool
|
||||
*/
|
||||
function next_result() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Get single field from result
|
||||
* @param string
|
||||
* @param int
|
||||
* @return string|bool
|
||||
*/
|
||||
function result($query, $field = 0) {
|
||||
$result = $this->query($query);
|
||||
if (!is_object($result)) {
|
||||
return false;
|
||||
}
|
||||
$row = $result->fetch_row();
|
||||
return ($row ? $row[$field] : false);
|
||||
}
|
||||
}
|
@@ -79,7 +79,7 @@ abstract class SqlDriver {
|
||||
* @param list<string> result of $adminer->selectSearchProcess()
|
||||
* @param list<string> result of $adminer->selectColumnsProcess()[1]
|
||||
* @param list<string> result of $adminer->selectOrderProcess()
|
||||
* @param int result of $adminer->selectLimitProcess()
|
||||
* @param int|numeric-string result of $adminer->selectLimitProcess()
|
||||
* @param int index of page starting at zero
|
||||
* @param bool whether to print the query
|
||||
* @return Result|false
|
||||
|
@@ -64,8 +64,8 @@ function get_lang() {
|
||||
* @param float|string
|
||||
* @return string
|
||||
*/
|
||||
// this is matched by compile.php
|
||||
function lang($idf, $number = null) {
|
||||
// this is matched by compile.php
|
||||
global $LANG, $translations;
|
||||
$translation = ($translations[$idf] ?: $idf);
|
||||
if (is_array($translation)) {
|
||||
|
@@ -3,14 +3,19 @@ namespace Adminer;
|
||||
|
||||
// PDO can be used in several database drivers
|
||||
if (extension_loaded('pdo')) {
|
||||
abstract class PdoDb {
|
||||
public $flavor = '', $server_info, $affected_rows, $errno, $error;
|
||||
protected $pdo;
|
||||
private $result;
|
||||
abstract class PdoDb extends SqlDb {
|
||||
/** @var \PDO */ protected $pdo;
|
||||
|
||||
/** Connect to server using DSN
|
||||
* @param string
|
||||
* @param string
|
||||
* @param string
|
||||
* @param mixed[]
|
||||
* @return void
|
||||
*/
|
||||
function dsn($dsn, $username, $password, $options = array()) {
|
||||
$options[\PDO::ATTR_ERRMODE] = \PDO::ERRMODE_SILENT;
|
||||
$options[\PDO::ATTR_STATEMENT_CLASS] = array('Adminer\PdoDbStatement');
|
||||
$options[\PDO::ATTR_STATEMENT_CLASS] = array('Adminer\PdoResult');
|
||||
try {
|
||||
$this->pdo = new \PDO($dsn, $username, $password, $options);
|
||||
} catch (\Exception $ex) {
|
||||
@@ -19,13 +24,12 @@ if (extension_loaded('pdo')) {
|
||||
$this->server_info = @$this->pdo->getAttribute(\PDO::ATTR_SERVER_VERSION);
|
||||
}
|
||||
|
||||
abstract function select_db($database);
|
||||
|
||||
function quote($string) {
|
||||
return $this->pdo->quote($string);
|
||||
}
|
||||
|
||||
function query($query, $unbuffered = false) {
|
||||
/** @var Result|bool */
|
||||
$result = $this->pdo->query($query);
|
||||
$this->error = "";
|
||||
if (!$result) {
|
||||
@@ -39,13 +43,9 @@ if (extension_loaded('pdo')) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
function multi_query($query) {
|
||||
return $this->result = $this->query($query);
|
||||
}
|
||||
|
||||
function store_result($result = null) {
|
||||
if (!$result) {
|
||||
$result = $this->result;
|
||||
$result = $this->multi;
|
||||
if (!$result) {
|
||||
return false;
|
||||
}
|
||||
@@ -59,24 +59,15 @@ if (extension_loaded('pdo')) {
|
||||
}
|
||||
|
||||
function next_result() {
|
||||
if (!$this->result) {
|
||||
if (!is_object($this->multi)) {
|
||||
return false;
|
||||
}
|
||||
$this->result->_offset = 0;
|
||||
return @$this->result->nextRowset(); // @ - PDO_PgSQL doesn't support it
|
||||
}
|
||||
|
||||
function result($query, $field = 0) {
|
||||
$result = $this->query($query);
|
||||
if (!$result) {
|
||||
return false;
|
||||
}
|
||||
$row = $result->fetch();
|
||||
return $row ? $row[$field] : false;
|
||||
$this->multi->_offset = 0;
|
||||
return @$this->multi->nextRowset(); // @ - PDO_PgSQL doesn't support it
|
||||
}
|
||||
}
|
||||
|
||||
class PdoDbStatement extends \PDOStatement {
|
||||
class PdoResult extends \PDOStatement {
|
||||
public $_offset = 0, $num_rows;
|
||||
|
||||
function fetch_assoc() {
|
||||
@@ -87,10 +78,6 @@ if (extension_loaded('pdo')) {
|
||||
return $this->fetch(\PDO::FETCH_NUM);
|
||||
}
|
||||
|
||||
function fetch_column($field) {
|
||||
return $this->fetchColumn($field);
|
||||
}
|
||||
|
||||
function fetch_field() {
|
||||
$row = (object) $this->getColumnMeta($this->_offset++);
|
||||
$type = $row->pdo_type;
|
||||
|
Reference in New Issue
Block a user