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


PHP Connection::fetchAll方法代碼示例

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


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

示例1: testStartToEndExecution

 public function testStartToEndExecution()
 {
     $workflow = new \ezcWorkflow('Test');
     $workflow->startNode->addOutNode($workflow->endNode);
     $this->manager->save($workflow);
     $execution = $this->manager->createExecution($workflow);
     $execution->workflow = $workflow;
     $execution->setVariable('foo', 'bar');
     $execution->setVariable('bar', 'baz');
     $execution->start();
     $this->assertEquals(0, count($this->conn->fetchAll('SELECT * FROM ' . $this->options->executionTable())));
     $this->assertEquals(0, count($this->conn->fetchAll('SELECT * FROM ' . $this->options->executionStateTable())));
 }
開發者ID:beberlei,項目名稱:Doctrine-Workflow,代碼行數:13,代碼來源:DoctrineExecutionTest.php

示例2: getAll

 public static function getAll($mysqli)
 {
     $stmt = $mysqli->prepare("\n      SELECT * FROM `settings`\n    ");
     $res = array();
     foreach (Connection::fetchAll($stmt) as $row) {
         $res[$row->key] = $row->value;
     }
     return $res;
 }
開發者ID:KristopherWindsor,項目名稱:portfolio,代碼行數:9,代碼來源:SettingsApi.php

示例3: getMultiYear

 public static function getMultiYear($mysqli, $start_year, $end_year)
 {
     $stmt = $mysqli->prepare("\n      SELECT * FROM `annual_breakdown`\n      WHERE `year` >= ? AND `year` <= ?\n    ");
     $stmt->bind_param('ii', $start_year, $end_year);
     foreach (Connection::fetchAll($stmt) as $row) {
         $row = self::scaleDown($row);
         $res[$row->year][$row->category] = $row->value;
     }
     return $res;
 }
開發者ID:KristopherWindsor,項目名稱:portfolio,代碼行數:10,代碼來源:AnnualApi.php

示例4: getInvestmentsHelper

 private static function getInvestmentsHelper($mysqli, $start_year, $end_year, $start_month = 1, $end_month = 12)
 {
     $stmt = $mysqli->prepare("\n      SELECT\n        *,\n        `value_ret_pretax` + `value_ret_posttax` AS `value_ret`,\n        `value_no_ret`     + `value_ret_posttax` AS `value_posttax`,\n        `value_ret_pretax` + `value_ret_posttax` + `value_no_ret` AS `value`\n      FROM `investments`\n      LEFT JOIN `investment_category` ON `category_key` = `key`\n      WHERE\n        (`year` > ? OR (`year` = ? AND `month` >= ?)) AND\n        (`year` < ? OR (`year` = ? AND `month` <= ?))\n      ORDER BY `year`, `month`, `rank` desc\n    ");
     $stmt->bind_param('iiiiii', $start_year, $start_year, $start_month, $end_year, $end_year, $end_month);
     $res = Connection::fetchAll($stmt);
     foreach ($res as $key => $i) {
         $res[$key] = self::scaleDown($i);
     }
     return $res;
 }
開發者ID:KristopherWindsor,項目名稱:portfolio,代碼行數:10,代碼來源:InvestmentsApi.php

示例5: getTargets

 public static function getTargets($mysqli)
 {
     $stmt = $mysqli->prepare("\n      SELECT * FROM `investment_target` LEFT JOIN investment_category ON `category_key` = `key` ORDER BY `percent` desc\n    ");
     return Connection::fetchAll($stmt);
 }
開發者ID:KristopherWindsor,項目名稱:portfolio,代碼行數:5,代碼來源:TargetApi.php

示例6: allAsArray

 /**
  * @param array $columnsToSelect
  * @return array
  */
 public function allAsArray($columnsToSelect = ['*'])
 {
     return $this->connection->fetchAll($this->getSelectQuery($columnsToSelect), $this->getBindingValues());
 }
開發者ID:serendip811,項目名稱:patio42,代碼行數:8,代碼來源:QueryBuilder.php


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