]> git.joonet.de Git - adminer.git/commitdiff
Fix multi_query
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 19 Feb 2010 14:33:49 +0000 (14:33 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 19 Feb 2010 14:33:49 +0000 (14:33 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1323 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/include/pdo.inc.php
tests/0-login.html

index 5836a23c4f10bf9c0abf941d44025082c9459635..a8d949ec7a9f0a0698d491b8162897296ce56002 100644 (file)
@@ -20,32 +20,30 @@ if (extension_loaded('pdo')) {
                }
                
                function query($query, $unbuffered = false) {
-                       $return = parent::query($query);
-                       if (!$return) {
+                       $result = parent::query($query);
+                       if (!$result) {
                                $errorInfo = $this->errorInfo();
                                $this->error = $errorInfo[2];
                                return false;
                        }
-                       if ($return->columnCount()) {
-                               $this->affected_rows = $return->rowCount();
-                       } else {
-                               $return->num_rows = $return->rowCount(); // is not guaranteed to work with all drivers
-                       }
-                       return $return;
+                       $this->store_result($result);
+                       return $result;
                }
                
                function multi_query($query) {
                        return $this->_result = $this->query($query);
                }
                
-               function store_result() {
-                       $return = &$this->_result;
-                       if ($return->columnCount()) {
-                               $this->affected_rows = $return->rowCount();
-                               return true;
+               function store_result($result = null) {
+                       if (!$result) {
+                               $result = $this->_result;
+                       }
+                       if ($result->columnCount()) {
+                               $result->num_rows = $result->rowCount(); // is not guaranteed to work with all drivers
+                               return $result;
                        }
-                       $return->num_rows = $return->rowCount();
-                       return $return;
+                       $this->affected_rows = $result->rowCount();
+                       return true;
                }
                
                function next_result() {
index 8cd77a45acb4a97402fccf759264f56f44e17c6b..f238acca35e06b347119de2eeb967e9ccba018cd 100644 (file)
@@ -4,12 +4,12 @@
 <head profile="http://selenium-ide.openqa.org/profiles/test-case">
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 <link rel="selenium.base" href="" />
-<title>Create database</title>
+<title>Login</title>
 </head>
 <body>
 <table cellpadding="1" cellspacing="1" border="1">
 <thead>
-<tr><td rowspan="1" colspan="3">Create database</td></tr>
+<tr><td rowspan="1" colspan="3">Login</td></tr>
 </thead><tbody>
 <tr>
        <td>open</td>
@@ -18,7 +18,7 @@
 </tr>
 <tr>
        <td>open</td>
-       <td>/adminer/adminer/?lang=en&amp;username=</td>
+       <td>/adminer/adminer/?lang=en&amp;username=ODBC</td>
        <td></td>
 </tr>
 <tr>