Fix multi_query

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1323 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2010-02-19 14:33:49 +00:00
parent 3a76704f58
commit e94c2b90de
2 changed files with 16 additions and 18 deletions

View file

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

View file

@ -4,12 +4,12 @@
<head profile="http://selenium-ide.openqa.org/profiles/test-case"> <head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="" /> <link rel="selenium.base" href="" />
<title>Create database</title> <title>Login</title>
</head> </head>
<body> <body>
<table cellpadding="1" cellspacing="1" border="1"> <table cellpadding="1" cellspacing="1" border="1">
<thead> <thead>
<tr><td rowspan="1" colspan="3">Create database</td></tr> <tr><td rowspan="1" colspan="3">Login</td></tr>
</thead><tbody> </thead><tbody>
<tr> <tr>
<td>open</td> <td>open</td>
@ -18,7 +18,7 @@
</tr> </tr>
<tr> <tr>
<td>open</td> <td>open</td>
<td>/adminer/adminer/?lang=en&amp;username=</td> <td>/adminer/adminer/?lang=en&amp;username=ODBC</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>