本文整理汇总了PHP中QueryExecutor类的典型用法代码示例。如果您正苦于以下问题:PHP QueryExecutor类的具体用法?PHP QueryExecutor怎么用?PHP QueryExecutor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QueryExecutor类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getListAllTeamDashboard
protected function getListAllTeamDashboard($sqlQuery)
{
$tab = QueryExecutor::execute($sqlQuery);
$ret = array();
for ($i = 0; $i < count($tab); $i++) {
$ret[$i] = $this->readRowAllTeamDashboard($tab[$i]);
}
return $ret;
}
示例2: getRowResponse
/**
* Get row
*
* @return ChallengeResponsesMySql
*/
protected function getRowResponse($sqlQuery)
{
$tab = QueryExecutor::execute($sqlQuery);
if (count($tab) == 0) {
return null;
}
return $this->readRowResponse($tab[0]);
}
示例3: executeInsert
public static function executeInsert($sqlQuery)
{
global $logger;
$result = QueryExecutor::executeUpdate($sqlQuery);
$logger->debug("Execute Update Result: " . print_r($result, true));
$lastInsertedId = mysql_insert_id();
$logger->debug("Execute Insert Result: '{$lastInsertedId}'");
return $lastInsertedId;
}
示例4: getListUsers
protected function getListUsers($sqlQuery)
{
$tab = QueryExecutor::execute($sqlQuery);
$ret = array();
for ($i = 0; $i < count($tab); $i++) {
$ret[$i] = $this->readUserRow($tab[$i]);
}
return $ret;
}
示例5: getStudentClassScoreList
protected function getStudentClassScoreList($sqlQuery)
{
$tab = QueryExecutor::execute($sqlQuery);
$ret = array();
for ($i = 0; $i < count($tab); $i++) {
$ret[$i] = $this->readStudentClassScoreRow($tab[$i]);
}
return $ret;
}
示例6: getLastTemporadaOfSerie
public function getLastTemporadaOfSerie($idSerie)
{
$sql = 'SELECT MAX(temporada) temporada FROM vod WHERE id_serie = ?';
$sqlQuery = new SqlQuery($sql);
$sqlQuery->set($idSerie);
$tab = QueryExecutor::execute($sqlQuery);
if (count($tab) == 0) {
return null;
}
return $tab[0]['temporada'];
}
示例7: executeInsert
/**
* Insert row to table
*/
protected function executeInsert($sqlQuery)
{
return QueryExecutor::executeInsert($sqlQuery);
}
示例8: executeInsert
public static function executeInsert($sqlQuery)
{
QueryExecutor::executeUpdate($sqlQuery);
return mysql_insert_id();
}
示例9: getFields
function getFields($table)
{
$sql = 'DESC ' . $table;
return QueryExecutor::execute(new SqlQuery($sql));
}
示例10: getStudentScoreList
protected function getStudentScoreList($sqlQuery)
{
$tab = QueryExecutor::execute($sqlQuery);
return $tab;
}
示例11: registerFilters
private function registerFilters()
{
$command = $this->register('filters');
// set description
$command->setDescription('Returns possible filters for query');
// set arguments
$command->setDefinition(array(new InputOption('filters', null, InputOption::VALUE_REQUIRED, 'Formatted filters: filter1=value1,value2;filter2=value3,value4'), new InputArgument('query', InputArgument::REQUIRED, 'Query')));
// set action
$command->setCode(function (InputInterface $input, OutputInterface $output) {
// get argument id
$query = $input->getArgument('query');
$setting = SettingsStorage::getInstance();
$code = $setting->getById('code');
$key = $setting->getById('key');
if (empty($code)) {
$code = 1;
} else {
$code = (int) $code['value'];
}
if (empty($key)) {
$output->writeln("Allegro web api key not set, use 'config key XXXXXX' to configure");
return;
} else {
$key = $key['value'];
}
$filters = $input->getOption('filters');
$api = new AllegroApi($key, $code);
// returns filters
foreach (QueryExecutor::getFilters($api, $query, $filters) as $filter) {
$output->writeln(sprintf("<info>%-30s</info>\t%-30s\n%s\n", "<info>{$filter['name']} " . ($filter['range'] ? '=[min,max]' : '') . "</info>", $filter['description'], implode(', ', array_map(function ($item) {
return "{$item['value']} - '{$item['name']}'";
}, $filter['values']))));
}
});
}
示例12: file_get_contents
<?php
/**
* Arquivo de instalação, deve ser deletado após o uso
*
*/
/**
* Include do arquivo de configuração
*/
require 'config.php';
/**
* Criação da tabela e populando o banco
*/
$arquivo = file_get_contents('extras/sql.sql');
$arquivo = explode(';', $arquivo);
foreach ($arquivo as $linha) {
QueryExecutor::executeSimpleQuery($linha);
}
/**
* Retorno
*/
echo 'Parabéns! Instalação efetuada com sucesso!<br /><br /><a href="' . blog_url . '">Ir para página inicial</a>';
示例13: executeInsert
public static function executeInsert($sqlQuery)
{
QueryExecutor::executeUpdate($sqlQuery);
return mysqli_insert_id(ConnectionFactory::getConnection());
}
示例14: getFields
function getFields($table)
{
$sql = 'DESC ' . $table;
$rettab = array();
$r = 0;
$origtab = QueryExecutor::execute(new SqlQuery($sql));
for ($i = 0; $i < count($origtab); $i++) {
$fieldname = $origtab[$i][0];
$row = $origtab[$i];
switch ($fieldname) {
case 'rid':
break;
case 'is_deleted':
break;
case 'create_epoch':
break;
case 'delete_epoch':
break;
default:
$rettab[$r++] = $row;
break;
}
}
return $rettab;
}