Fix multiquery

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1319 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2010-02-18 16:39:00 +00:00
parent 98197cb42d
commit 7896227762
3 changed files with 18 additions and 12 deletions

View file

@ -66,7 +66,8 @@ if (extension_loaded("mysqli")) {
if (!$result) { if (!$result) {
$this->error = mysql_error($this->_link); $this->error = mysql_error($this->_link);
return false; return false;
} elseif ($result === true) { }
if ($result === true) {
$this->affected_rows = mysql_affected_rows($this->_link); $this->affected_rows = mysql_affected_rows($this->_link);
$this->info = mysql_info($this->_link); $this->info = mysql_info($this->_link);
return true; return true;

View file

@ -20,27 +20,32 @@ if (extension_loaded('pdo')) {
} }
function query($query, $unbuffered = false) { function query($query, $unbuffered = false) {
$result = parent::query($query); $return = parent::query($query);
if (!$result) { if (!$return) {
$errorInfo = $this->errorInfo(); $errorInfo = $this->errorInfo();
$this->error = $errorInfo[2]; $this->error = $errorInfo[2];
return false; return false;
} }
$this->_result = $result; if ($return->columnCount()) {
if (!$result->columnCount()) { $this->affected_rows = $return->rowCount();
$this->affected_rows = $result->rowCount(); } else {
return true; $return->num_rows = $return->rowCount(); // is not guaranteed to work with all drivers
} }
$result->num_rows = $result->rowCount(); // is not guaranteed to work with all drivers return $return;
return $result;
} }
function multi_query($query) { function multi_query($query) {
return $this->query($query); return $this->_result = $this->query($query);
} }
function store_result() { function store_result() {
return ($this->_result->columnCount() ? $this->_result : true); $return = &$this->_result;
if ($return->columnCount()) {
$this->affected_rows = $return->rowCount();
return true;
}
$return->num_rows = $return->rowCount();
return $return;
} }
function next_result() { function next_result() {

View file

@ -1,7 +1,6 @@
MySQL 5 BIT data type MySQL 5 BIT data type
Transactions in export Transactions in export
Create view and routine options Create view and routine options
Highlight SQL textarea - may use external CodePress
Mass editation of individual rows Mass editation of individual rows
Offer enum and set items in search - whisperer Offer enum and set items in search - whisperer
Variables editation, especially timezone Variables editation, especially timezone
@ -9,6 +8,7 @@ Use event $intervals + microseconds in relative date functions
Optionally check IP address Optionally check IP address
Disable spell checking in SQL textareas - spellcheck="false" Disable spell checking in SQL textareas - spellcheck="false"
Accept Tab in SQL textareas, Ctrl+Enter to send form Accept Tab in SQL textareas, Ctrl+Enter to send form
Highlight SQL textarea, then display query inside textarea in select - may use external CodePress
Blob download and image display in edit form (important for Editor with hidden fields in select) Blob download and image display in edit form (important for Editor with hidden fields in select)
Add title to Logout, edit (in select) and select (in menu) in style "hever" Add title to Logout, edit (in select) and select (in menu) in style "hever"
? Column and table names auto-completition in SQL textarea ? Column and table names auto-completition in SQL textarea