diff --git a/adodb.inc.php b/adodb.inc.php index e7d867191..73bef1efd 100644 --- a/adodb.inc.php +++ b/adodb.inc.php @@ -1666,6 +1666,18 @@ function _Execute($sql,$inputarr=false) { return $rs; } + /** + * Execute a query. + * + * @param string|array $sql Query to execute. + * @param array $inputarr An optional array of parameters. + * + * @return mixed|bool Query identifier or true if execution successful, false if failed. + */ + function _query($sql, $inputarr = false) { + return false; + } + function CreateSequence($seqname='adodbseq',$startID=1) { if (empty($this->_genSeqSQL)) { return false; diff --git a/drivers/adodb-ado.inc.php b/drivers/adodb-ado.inc.php index fc000cecb..a0b6ffa91 100644 --- a/drivers/adodb-ado.inc.php +++ b/drivers/adodb-ado.inc.php @@ -208,10 +208,6 @@ function MetaColumns($table, $normalize=true) return empty($arr) ? $false : $arr; } - - - - /* returns queryID or false */ function _query($sql,$inputarr=false) { diff --git a/drivers/adodb-ado5.inc.php b/drivers/adodb-ado5.inc.php index 36f9c3b8d..8b641cf7d 100644 --- a/drivers/adodb-ado5.inc.php +++ b/drivers/adodb-ado5.inc.php @@ -233,7 +233,6 @@ function MetaColumns($table, $normalize=true) return $arr; } - /* returns queryID or false */ function _query($sql,$inputarr=false) { try { // In PHP5, all COM errors are exceptions, so to maintain old behaviour... diff --git a/drivers/adodb-ads.inc.php b/drivers/adodb-ads.inc.php index 8b877b6df..16eec9766 100644 --- a/drivers/adodb-ads.inc.php +++ b/drivers/adodb-ads.inc.php @@ -564,7 +564,6 @@ function Prepare($sql) return array($sql, $stmt, false); } - /* returns queryID or false */ function _query($sql, $inputarr = false) { $last_php_error = $this->resetLastError(); diff --git a/drivers/adodb-fbsql.inc.php b/drivers/adodb-fbsql.inc.php index a4255eb97..64913bc24 100644 --- a/drivers/adodb-fbsql.inc.php +++ b/drivers/adodb-fbsql.inc.php @@ -134,7 +134,6 @@ function SelectDB($dbName) } - // returns queryID or false function _query($sql,$inputarr=false) { return fbsql_query("$sql;",$this->_connectionID); diff --git a/drivers/adodb-firebird.inc.php b/drivers/adodb-firebird.inc.php index 133d9f43c..db3cca5d6 100644 --- a/drivers/adodb-firebird.inc.php +++ b/drivers/adodb-firebird.inc.php @@ -483,14 +483,14 @@ public function prepare($sql) } /** - * Return the query id. - * - * @param string|array $sql - * @param array $iarr - * - * @return bool|object - */ - function _query($sql, $iarr = false) + * Execute a query. + * + * @param string|array $sql Query to execute. + * @param array $inputarr An optional array of parameters. + * + * @return object|bool Query identifier or true if execution successful, false if failed. + */ + function _query($sql, $inputarr = false) { if (!$this->isConnected()) { return false; @@ -512,8 +512,8 @@ function _query($sql, $iarr = false) $fn = 'fbird_query'; $args = [$conn, $sql]; } - if (is_array($iarr)) { - $args = array_merge($args, $iarr); + if (is_array($inputarr)) { + $args = array_merge($args, $inputarr); } $ret = call_user_func_array($fn, $args); diff --git a/drivers/adodb-ibase.inc.php b/drivers/adodb-ibase.inc.php index 25a9c3e86..fe9e033b0 100644 --- a/drivers/adodb-ibase.inc.php +++ b/drivers/adodb-ibase.inc.php @@ -332,7 +332,7 @@ function Prepare($sql) // returns query ID if successful, otherwise false // there have been reports of problems with nested queries - the code is probably not re-entrant? - function _query($sql,$iarr=false) + function _query($sql, $inputarr = false) { if (!$this->autoCommit && $this->_transactionID) { $conn = $this->_transactionID; @@ -344,11 +344,11 @@ function _query($sql,$iarr=false) if (is_array($sql)) { $fn = 'ibase_execute'; $sql = $sql[1]; - if (is_array($iarr)) { - if (!isset($iarr[0])) { - $iarr[0] = ''; // PHP5 compat hack + if (is_array($inputarr)) { + if (!isset($inputarr[0])) { + $inputarr[0] = ''; // PHP5 compat hack } - $fnarr = array_merge(array($sql), $iarr); + $fnarr = array_merge(array($sql), $inputarr); $ret = call_user_func_array($fn, $fnarr); } else { $ret = $fn($sql); @@ -356,11 +356,11 @@ function _query($sql,$iarr=false) } else { $fn = 'ibase_query'; - if (is_array($iarr)) { - if (sizeof($iarr) == 0) { - $iarr[0] = ''; // PHP5 compat hack + if (is_array($inputarr)) { + if (sizeof($inputarr) == 0) { + $inputarr[0] = ''; // PHP5 compat hack } - $fnarr = array_merge(array($conn, $sql), $iarr); + $fnarr = array_merge(array($conn, $sql), $inputarr); $ret = call_user_func_array($fn, $fnarr); } else { $ret = $fn($conn, $sql); diff --git a/drivers/adodb-informix72.inc.php b/drivers/adodb-informix72.inc.php index 759bd5c8f..6fddde3d6 100644 --- a/drivers/adodb-informix72.inc.php +++ b/drivers/adodb-informix72.inc.php @@ -334,7 +334,6 @@ function Prepare($sql) else return array($sql,$stmt); } */ - // returns query ID if successful, otherwise false function _query($sql,$inputarr=false) { global $ADODB_COUNTRECS; diff --git a/drivers/adodb-ldap.inc.php b/drivers/adodb-ldap.inc.php index 323b35856..305f6a7ff 100644 --- a/drivers/adodb-ldap.inc.php +++ b/drivers/adodb-ldap.inc.php @@ -157,7 +157,6 @@ function _inject_bind_options( $options ) { } } - /* returns _queryID or false */ function _query($sql,$inputarr=false) { $rs = @ldap_search( $this->_connectionID, $this->database, $sql ); diff --git a/drivers/adodb-mssql.inc.php b/drivers/adodb-mssql.inc.php index 269dd7ed3..c0b714ede 100644 --- a/drivers/adodb-mssql.inc.php +++ b/drivers/adodb-mssql.inc.php @@ -725,7 +725,6 @@ function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB') return $this->Execute($sql) != false; } - // returns query ID if successful, otherwise false function _query($sql,$inputarr=false) { $this->_errorMsg = false; diff --git a/drivers/adodb-mysqli.inc.php b/drivers/adodb-mysqli.inc.php index dcdb487bc..8dc67b887 100644 --- a/drivers/adodb-mysqli.inc.php +++ b/drivers/adodb-mysqli.inc.php @@ -1179,14 +1179,14 @@ private function getBindParamWithType($inputArr): array } /** - * Return the query id. - * - * @param string|array $sql - * @param array $inputarr - * - * @return bool|mysqli_result + * Execute a query. + * + * @param string|array $sql Query to execute. + * @param array $inputarr An optional array of parameters. + * + * @return mysqli_result|bool */ - function _query($sql, $inputarr) + function _query($sql, $inputarr = false) { global $ADODB_COUNTRECS; // Move to the next recordset, or return false if there is none. In a stored proc diff --git a/drivers/adodb-oci8.inc.php b/drivers/adodb-oci8.inc.php index 211fa9a2c..f361d6836 100644 --- a/drivers/adodb-oci8.inc.php +++ b/drivers/adodb-oci8.inc.php @@ -1272,7 +1272,8 @@ function Parameter(&$stmt,&$var,$name,$isOutput=false,$maxLen=4000,$type=false) } /** - * returns query ID if successful, otherwise false + * Execute a query. + * * this version supports: * * 1. $db->execute('select * from table'); @@ -1285,6 +1286,11 @@ function Parameter(&$stmt,&$var,$name,$isOutput=false,$maxLen=4000,$type=false) * 4. $db->prepare('insert into table (a,b,c) values (:0,:1,:2)'); * $db->bind($stmt,1); $db->bind($stmt,2); $db->bind($stmt,3); * $db->execute($stmt); + * + * @param string|array $sql Query to execute. + * @param array $inputarr An optional array of parameters. + * + * @return mixed|bool Query identifier or true if execution successful, false if failed. */ function _query($sql,$inputarr=false) { diff --git a/drivers/adodb-oci8po.inc.php b/drivers/adodb-oci8po.inc.php index aaf4bb5fa..71c203b62 100644 --- a/drivers/adodb-oci8po.inc.php +++ b/drivers/adodb-oci8po.inc.php @@ -70,7 +70,16 @@ function SelectLimit($sql, $nrows=-1, $offset=-1, $inputarr=false, $secs2cache=0 return ADOConnection::SelectLimit($sql, $nrows, $offset, $inputarr, $secs2cache); } - // emulate handling of parameters ? ?, replacing with :bind0 :bind1 + /** + * Execute a query. + * + * Emulate handling of parameters ? ?, replacing with :bind0 :bind1 + * + * @param string|array $sql Query to execute. + * @param array $inputarr An optional array of parameters. + * + * @return mixed|bool Query identifier or true if execution successful, false if failed. + */ function _query($sql,$inputarr=false) { if (is_array($inputarr)) { diff --git a/drivers/adodb-odbc.inc.php b/drivers/adodb-odbc.inc.php index 508711a30..9b214c533 100644 --- a/drivers/adodb-odbc.inc.php +++ b/drivers/adodb-odbc.inc.php @@ -518,7 +518,6 @@ function Prepare($sql) return array($sql,$stmt,false); } - /* returns queryID or false */ function _query($sql,$inputarr=false) { $last_php_error = $this->resetLastError(); diff --git a/drivers/adodb-oracle.inc.php b/drivers/adodb-oracle.inc.php index 1a2735b14..dc0462fe2 100644 --- a/drivers/adodb-oracle.inc.php +++ b/drivers/adodb-oracle.inc.php @@ -181,7 +181,6 @@ function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) } - // returns query ID if successful, otherwise false function _query($sql,$inputarr=false) { // Reset error messages before executing diff --git a/drivers/adodb-pdo.inc.php b/drivers/adodb-pdo.inc.php index 0fbe3e2f7..d3ce12d08 100644 --- a/drivers/adodb-pdo.inc.php +++ b/drivers/adodb-pdo.inc.php @@ -578,7 +578,6 @@ function GenID($seqname='adodbseq',$startID=1) } - /* returns queryID or false */ function _query($sql,$inputarr=false) { $ok = false; diff --git a/drivers/adodb-postgres64.inc.php b/drivers/adodb-postgres64.inc.php index 23a219589..9bf9e713c 100644 --- a/drivers/adodb-postgres64.inc.php +++ b/drivers/adodb-postgres64.inc.php @@ -784,7 +784,6 @@ function _pconnect($str,$user='',$pwd='',$db='') } - // returns queryID or false function _query($sql,$inputarr=false) { $this->_pnum = 0; diff --git a/drivers/adodb-sqlite.inc.php b/drivers/adodb-sqlite.inc.php index 0711f1dde..d41829c04 100644 --- a/drivers/adodb-sqlite.inc.php +++ b/drivers/adodb-sqlite.inc.php @@ -211,7 +211,6 @@ function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) return true; } - // returns query ID if successful, otherwise false function _query($sql,$inputarr=false) { $rez = sqlite_query($sql,$this->_connectionID); diff --git a/drivers/adodb-sqlite3.inc.php b/drivers/adodb-sqlite3.inc.php index 318171a8c..7623a3c88 100644 --- a/drivers/adodb-sqlite3.inc.php +++ b/drivers/adodb-sqlite3.inc.php @@ -331,7 +331,6 @@ function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename); } - // returns query ID if successful, otherwise false function _query($sql,$inputarr=false) { $rez = $this->_connectionID->query($sql); diff --git a/drivers/adodb-sybase.inc.php b/drivers/adodb-sybase.inc.php index 5eb217a84..79fb82e8b 100644 --- a/drivers/adodb-sybase.inc.php +++ b/drivers/adodb-sybase.inc.php @@ -170,7 +170,6 @@ function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) return true; } - // returns query ID if successful, otherwise false function _query($sql,$inputarr=false) { global $ADODB_COUNTRECS; diff --git a/drivers/adodb-text.inc.php b/drivers/adodb-text.inc.php index 77ad06a0b..36a1a0d4d 100644 --- a/drivers/adodb-text.inc.php +++ b/drivers/adodb-text.inc.php @@ -129,14 +129,21 @@ function Connect(&$array, $types = false, $colnames = false) return true; } - - - // returns queryID or false - // We presume that the select statement is on the same table (what else?), - // with the only difference being the order by. - //You can filter by using $eval and each clause is stored in $arr .eg. $arr[1] == 'name' - // also supports SELECT [DISTINCT] COL FROM ... -- only 1 col supported - function _query($sql,$input_arr,$eval=false) + /** + * Execute a query. + * + * We presume that the select statement is on the same table (what else?), + * with the only difference being the order by. + * You can filter by using $eval and each clause is stored in $arr e.g. $arr[1] == 'name' + * also supports SELECT [DISTINCT] COL FROM ... -- only 1 col supported + * + * @param string|array $sql Query to execute. + * @param array $inputarr An optional array of parameters. + * @param string $eval Optional eval string + * + * @return mixed|bool Query identifier or true if execution successful, false if failed. + */ + function _query($sql, $inputarr=false, $eval=false) { if ($this->_origarray === false) return false;