当前位置: 首页>>代码示例>>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;未经允许,请勿转载。