本文整理汇总了PHP中SQL::cmdvalue方法的典型用法代码示例。如果您正苦于以下问题:PHP SQL::cmdvalue方法的具体用法?PHP SQL::cmdvalue怎么用?PHP SQL::cmdvalue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQL
的用法示例。
在下文中一共展示了SQL::cmdvalue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getVotes
public static function getVotes($data)
{
if (!isset($data["question"])) {
throw new APIException("Benötigter Parameter fehlt (question).", 50);
}
$db = new SQL(0);
return $db->cmdvalue(0, 'SELECT count_votes FROM questions WHERE id={0}', array($data["question"] + 0));
}
示例2: load
public static function load($id)
{
$db = new SQL(0);
$d = @unserialize($db->cmdvalue(0, 'SELECT `data` FROM `config` WHERE `key`="{0}" LIMIT 0,1', array($id)));
if (!is_array($d)) {
return false;
}
self::$datapart[$id] = $d;
self::$data = array_merge(self::$data, $d);
return true;
}
示例3: date
<?php
header("Content-Type: text/xml; Charset: UTF-8");
header("Content-Type: application/xml; Charset: UTF-8");
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">' . PHP_EOL;
$db = new SQL(0);
$maxviews = max(1, $db->cmdvalue(0, 'SELECT max(count_views) FROM questions WHERE 1'));
$rows = $db->cmdrows(0, 'SELECT id, title, date_edited, date_action, count_views FROM questions ORDER BY id DESC');
foreach ($rows as $row) {
echo '<url>
<loc>' . Question::PermalinkByData($row["id"], $row["title"]) . '</loc>
<lastmod>' . date("Y-m-d", $row["date_action"]) . 'T' . date("H:i:s", $row["date_action"]) . '+01:00</lastmod>
<changefreq>daily</changefreq>
<priority>' . (0.49 + 0.5 * $row["count_views"] / $maxviews) . '</priority>
</url>' . PHP_EOL;
}
?>
<url>
<loc><?php
echo $_ENV["baseurl"];
?>
questions</loc>
<lastmod><?php
echo date("Y-m-d");
?>
T01:00:00+01:00</lastmod>
<changefreq>daily</changefreq>
<priority>.99</priority>
</url>
<url>
示例4: _e
<article class="ContentLeft">
<?php
PageEngine::html("box_tags_navi", array("tag" => $params["id"]));
?>
<h1 class="search-result-summary"><?php
echo _e("Infos for Tag '{0}'", array(0 => $params["id"]));
?>
</h1>
<?php
BBCode::render(isset($info["long_desc"]) ? $info["long_desc"] : "", true);
if (!isset($info["long_desc"]) or trim($info["long_desc"]) == "") {
echo '<p class="noTagDescription">' . _e("Dieser Tag hat aktuell noch keine Erklärung. Ab 2500 Karma Punkten kannst Du diesen Artikel erstellen und so anderen Usern helfen oder einen kurzen Einblick in das Thema bieten.") . '</p>';
}
if (MyUser::isloggedin() and MyUser::getKarmaPoints() >= 2500 or MyUser::hasAdminRight()) {
echo '<a href="' . get_path("/tags/" . urlencode($params["id"]) . "/info/edit") . '"><button class="blue" type="button">' . _e("edit") . '</button></a>';
}
?>
</article>
<aside class="ContentRight">
<div style="text-align: center;">
<?php
$count = $db->cmdvalue(0, 'SELECT count(*) FROM question_tags WHERE tag="{0}" LIMIT 0,1', array($params["id"]));
echo '<span style="color: #808185; font-size: 30px; font-weight:bold;">' . number_format($count, 0, ",", ".") . '</span>';
?>
<br/>
<?php
echo _e("questions tagged");
?>
示例5: CountNew
public static function CountNew()
{
$db = new SQL(0);
$v = $db->cmdvalue(0, 'SELECT count(*) as Anzahl FROM mails WHERE to_user={0} AND is_read="0" LIMIT 0,1', array(MyUser::id()));
return $v + 0;
}