Просмотр исходного кода

[PHP-5.3-SUPPORT]
- Fixed Zend_Db_Statement_Mysqli to support usage of more_results()
- Fixed _execute() to use refernces when passed to bind_param (thanks to ScottMac)

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@16927 44c647ce-9c0f-0410-b52a-842ac1e357ba

ralph 16 лет назад
Родитель
Сommit
a39eaf9cea
1 измененных файлов с 9 добавлено и 3 удалено
  1. 9 3
      library/Zend/Db/Statement/Mysqli.php

+ 9 - 3
library/Zend/Db/Statement/Mysqli.php

@@ -125,7 +125,9 @@ class Zend_Db_Statement_Mysqli extends Zend_Db_Statement
     {
         if ($stmt = $this->_stmt) {
             $mysqli = $this->_adapter->getConnection();
-            while ($mysqli->next_result()) {}
+            while ($mysqli->more_results()) {
+                $mysqli->next_result();
+            }
             $this->_stmt->free_result();
             return $this->_stmt->reset();
         }
@@ -199,10 +201,14 @@ class Zend_Db_Statement_Mysqli extends Zend_Db_Statement
         // send $params as input parameters to the statement
         if ($params) {
             array_unshift($params, str_repeat('s', count($params)));
+            $stmtParams = array();
+            foreach ($params as $k => &$value) {
+                $stmtParams[$k] = &$value;
+            }
             call_user_func_array(
                 array($this->_stmt, 'bind_param'),
-                $params
-            );
+                $stmtParams
+                );
         }
 
         // execute the statement