本文整理汇总了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())));
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例6: allAsArray
/**
* @param array $columnsToSelect
* @return array
*/
public function allAsArray($columnsToSelect = ['*'])
{
return $this->connection->fetchAll($this->getSelectQuery($columnsToSelect), $this->getBindingValues());
}