當前位置: 首頁>>代碼示例>>PHP>>正文


PHP MySQLi::store_result方法代碼示例

本文整理匯總了PHP中MySQLi::store_result方法的典型用法代碼示例。如果您正苦於以下問題:PHP MySQLi::store_result方法的具體用法?PHP MySQLi::store_result怎麽用?PHP MySQLi::store_result使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在MySQLi的用法示例。


在下文中一共展示了MySQLi::store_result方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getDeviceFallBackTree

 public function getDeviceFallBackTree($wurflID)
 {
     if ($this->use_nested_set) {
         return $this->getDeviceFallBackTree_NS($wurflID);
     }
     $data = array();
     $this->numQueries++;
     $query = sprintf("CALL " . TeraWurflConfig::$TABLE_PREFIX . "_FallBackDevices(%s)", $this->SQLPrep($wurflID));
     $this->dbcon->multi_query($query);
     $i = 0;
     do {
         if ($res = $this->dbcon->store_result()) {
             $row = $res->fetch_row();
             $data[$i++] = unserialize($row[0]);
             $res->free();
         }
     } while ($this->dbcon->more_results() && $this->dbcon->next_result());
     if ($i == 0) {
         $tw = new TeraWurfl();
         $tw->toLog("Tera-WURFL Error: database fallback procedure returned no records, verify that " . TeraWurflConfig::$TABLE_PREFIX . "_FallBackDevices exists.", LOG_ERR, __CLASS__ . '::' . __FUNCTION__);
     } else {
         if ($data[$i - 1]['id'] != WurflConstants::NO_MATCH) {
             $tw = new TeraWurfl();
             $tw->toLog("WURFL Error: device {$data[$i - 1]['id']} falls back on an inexistent device: {$data[$i - 1]['fall_back']}", LOG_ERR, __CLASS__ . '::' . __FUNCTION__);
         }
     }
     return $data;
 }
開發者ID:sakibanda,項目名稱:ballistic-tracking,代碼行數:28,代碼來源:TeraWurflDatabase_MySQL5.php

示例2: multiQuery

 public function multiQuery($sSQL)
 {
     $start = microtime(true);
     $this->connect();
     // Increase the counter
     $this->query_counter++;
     $result = $this->connection->multi_query(trim($sSQL));
     // FLUSH RESULTS
     // @TODO make these usable
     do {
         $r = $this->connection->store_result();
         if ($r) {
             $r->free();
         }
         if (!$this->connection->more_results()) {
             break;
         }
         //$this->connection->next_result();
     } while ($this->connection->next_result());
     $duration = microtime(true) - $start;
     $this->addQueryLog($sSQL, $duration);
     if (!$result) {
         //var_dump (debug_backtrace ());
         //$data = debug_backtrace ();
         //print_r ($data);
         //echo $sSQL;
         $ex = new DbException('MySQL Error: ' . $this->connection->error);
         $ex->setQuery($sSQL);
         throw $ex;
     } elseif ($result instanceof MySQLi_Result) {
         return new Result($result);
     }
     // Insert ID will return zero if this query was not insert or update.
     $this->insert_id = intval($this->connection->insert_id);
     // Affected rows
     $this->affected_rows = intval($this->connection->affected_rows);
     if ($this->insert_id > 0) {
         return $this->insert_id;
     }
     if ($this->affected_rows > 0) {
         return $this->affected_rows;
     }
     return $result;
 }
開發者ID:catlabinteractive,項目名稱:neuron,代碼行數:44,代碼來源:MySQL.php

示例3: _multiQuery

 protected function _multiQuery($query)
 {
     $this->connect();
     $this->_driver->multi_query($query);
     if ($this->_driver->error) {
         throw new Miaox_SphinxQl_Connection_Exception('[' . $this->_driver->errno . '] ' . $this->_driver->error . ' [ ' . $query . ']');
     }
     $result = array();
     $count = 0;
     do {
         if (false !== ($resource = $this->_driver->store_result())) {
             $result[$count] = array();
             while (!is_null($row = $resource->fetch_assoc())) {
                 $result[$count][] = $row;
             }
             $resource->free_result();
         }
         $count++;
     } while ($this->_driver->more_results() && $this->_driver->next_result());
     return $result;
 }
開發者ID:theratg,項目名稱:miaox,代碼行數:21,代碼來源:Connection.class.php


注:本文中的MySQLi::store_result方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。