本文整理汇总了PHP中Crud::consultar方法的典型用法代码示例。如果您正苦于以下问题:PHP Crud::consultar方法的具体用法?PHP Crud::consultar怎么用?PHP Crud::consultar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Crud
的用法示例。
在下文中一共展示了Crud::consultar方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Crud
<span class="add-on"><i class="icon-filter"></i></span>
<input type="text" value="" name="searchrss" id="searchrss" placeholder="Filtrar feeds"/>
<span class="input-loader-feeds" style="margin-left: 10px; width: 24px; display: none;">
<img style="margin-bottom: 5px;" src="<?php
echo URL_BASE;
?>
/public/img/loader-mini.gif"/>
</span>
</div>
</form>
<div style="overflow-y:auto; height: 200px;" class="box-scroll">
<ul class="nav nav-list" id="alvosearchrss" >
<?php
$lista_feeds = new Crud();
$lista_feeds->setTabela('feeds');
$l_f = $lista_feeds->consultar(array('id', 'nome', 'url', 'publico', 'id_categoria'), 'id_user =' . $user['id'], 'created DESC')->fetchAll(PDO::FETCH_ASSOC);
foreach ($l_f as $l) {
echo '<li class="li-rss ';
if (isset($id_feed_atual) && $id_feed_atual == $l['id']) {
echo "active";
}
echo '"><a href="' . URL_BASE . '/feeds/' . $l['id'] . '">' . $l['nome'] . '</a></li>';
}
$nome_feed_inicial = $l_f[0]['nome'];
?>
</ul>
</div>
<ul class="nav nav-list">
<li class="divider"></li>
<li><a href="#addFeed" style="color: green !important;" data-toggle="modal" data-step="2" data-intro="Clicando neste botão você adiciona novos feeds." data-position="right"><i class="icon-plus"></i> Adicionar Feed</a></li>
<li><a href="#" style="color: green !important;"><i class="icon-edit"></i> Gerenciar Feeds</a></li>
示例2: Crud
$permalink = base64_decode($_GET['permalink']);
}
if (isset($_POST['userid'])) {
$iduser = $_POST['userid'];
} else {
$iduser = $_GET['iduser'];
}
$result_noticia = $noticia->consultar(array("id"), "permalink = '" . $permalink . "'");
$n = $result_noticia->fetch(PDO::FETCH_ASSOC);
if ($n == "") {
$avaliado = 0;
} else {
$avaliado = 1;
$nota = new Crud();
$nota->setTabela("notas");
$result_nota = $nota->consultar(array("nota"), "id_user = " . $iduser . " AND id_noticia = " . $n['id']);
$no = $result_nota->fetch(PDO::FETCH_ASSOC);
}
if (isset($no)) {
if ($no['nota'] == 1) {
$nota_dada = '<img src="' . URL_BASE . '/public/img/1-stars.png"/>';
} elseif ($no['nota'] == 2) {
$nota_dada = '<img src="' . URL_BASE . '/public/img/2-stars.png"/>';
} elseif ($no['nota'] == 3) {
$nota_dada = '<img src="' . URL_BASE . '/public/img/3-stars.png"/>';
} elseif ($no['nota'] == 4) {
$nota_dada = '<img src="' . URL_BASE . '/public/img/4-stars.png"/>';
} elseif ($no['nota'] == 5) {
$nota_dada = '<img src="' . URL_BASE . '/public/img/5-stars.png"/>';
}
}
示例3: primeiroLogin
public function primeiroLogin()
{
$pL = new Crud();
$pL->setTabela("users");
$result = $pL->consultar(array("id", "nome", "email"), "id = {$this->idInserido}");
$_SESSION['dehbora']['user'] = $result->fetch(PDO::FETCH_ASSOC);
}
示例4: feeds
function feeds($id)
{
$app = Slim::getInstance();
$app->view()->setData('id_feed_atual', $id);
if (!is_numeric($id)) {
$errors = "A página não existe";
$app->flash('errors', $errors);
$app->redirect(URL_BASE . '/');
exit;
}
$feeds = new Crud();
$feeds->setTabela('feeds');
$user = $app->view()->getData('user');
$l = $feeds->consultar(array('nome', 'url', 'publico', 'id_categoria'), 'id_user =' . $user['id'] . ' AND id =' . $id)->fetchAll(PDO::FETCH_ASSOC);
if (count($l) > 0) {
$read = new SimplePie();
$read->enable_cache(false);
$read->set_feed_url($l[0]['url']);
$read->set_url_replacements(array('a' => 'href', 'img' => 'src'));
$read->strip_htmltags(array('a'));
$read->init();
$read->handle_content_type();
$app->render('home.php', array('rss' => $read->get_items(), 'nome' => $l[0]['nome']));
} else {
echo "Esta página não existe";
}
}