本文整理汇总了PHP中connection::fetch_array方法的典型用法代码示例。如果您正苦于以下问题:PHP connection::fetch_array方法的具体用法?PHP connection::fetch_array怎么用?PHP connection::fetch_array使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类connection
的用法示例。
在下文中一共展示了connection::fetch_array方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: connection
function has_items($id)
{
$db = new connection();
$db->query('SELECT * FROM object WHERE type="page" AND status=1 AND parent_id=' . $id);
if ($this->has_child($id)) {
?>
<ul class="submenu">
<?php
}
while ($result = $db->fetch_array()) {
?>
<li><a href='./?page_id=<?php
echo $result['id'];
?>
'><?php
echo $result['menu_title'];
?>
</a>
<?php
if ($this->has_items($result['id'])) {
echo $this->has_items($result['id']);
}
?>
</li>
<?php
}
if ($this->has_child($id)) {
?>
</ul>
<?php
}
}
示例2: connection
function the_cat($by_name = null, $linked = null)
{
if ($this->is_object()) {
if (!empty($this->cat)) {
// Gibt die ID der Kategorie zurück
if (null == $by_name) {
return $this->cat;
// Gibt den Titel der Kategorie zurück
} else {
$db = new connection();
$get_the_catname = $db->query('SELECT * FROM object WHERE id=' . $this->cat);
$the_catname = $db->fetch_array();
if (null !== $linked) {
// Kategorie wird als Link ausgegeben
return '<a href="./?cat=' . $the_catname['id'] . '" rel="nofollow">' . $the_catname['title'] . '</a> ';
} else {
// Kategorie wird nicht als Link ausgegeben
return $the_catname['title'] . " ";
}
}
} else {
return false;
}
}
}
示例3: getAllCategories
public function getAllCategories()
{
$aCategories = array();
$oConnection = new connection();
$sSQL = "SELECT TypeID\n\t\tFROM tbproducttype";
$oResult = $oConnection->query($sSQL);
while ($aRow = $oConnection->fetch_array($oResult)) {
$oCategory = new category();
$oCategory->load($aRow["TypeID"]);
$aCategories[] = $oCategory;
}
$oConnection->close_connection();
return $aCategories;
}
示例4: connection
?>
</select>
</p>
<p>Startseite wählen</p>
<p>
<select name="startpage" class="input">
<option value="0">Die letzten Artikel</option>
<?php
$query2 = new connection();
$query2->query("SELECT * FROM object WHERE type='page' ORDER BY id");
while ($row2 = $query2->fetch_array()) {
$id = $row2['id'];
$title = $row2['menu_title'];
if ($row['id'] == $id) {
print "<option value=\"{$id}\" selected=\"selected\">{$title} </option>";
} else {
print "<option value=\"{$id}\">{$title} </option>";
}
}
?>
</select>
</p>
<p>Allgemeine SEO Keywords</p>
<p><input type="text" name="site_keywords" value="<?php
示例5: connection
case "category":
$link = "../?cat={$temp_o['id']}";
break;
}
echo "Du kannst deine Änderungen <a href='{$link}'>hier ansehen</a> oder <a href='index.php?page=item_modify&id=" . $temp_o['id'] . "'>erneut bearbeiten</a>";
} else {
if (isset($_GET['id'])) {
$id = $_GET['id'];
} else {
exit;
}
$db = new connection();
// Objektdaten aus der Datenbank holen - LIMIT auf 1 begrenzt
//
$db->query("SELECT * FROM object WHERE id = '{$id}' LIMIT 1");
$result = $db->fetch_array();
$res_id = $result['id'];
if (empty($result['nice_url'])) {
$nice_url = filter_var($result['title'], FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH);
$nice_url = preg_replace("/\\s+/", "-", $nice_url);
$nice_url = preg_replace("/:/", '', $nice_url);
$nice_url = strtolower($nice_url);
} else {
$nice_url = $result['nice_url'];
}
$menutitle = $result['menu_title'];
$title = $result['title'];
$keywords = $result['keywords'];
$description = $result['description'];
$text = $result['content'];
$parent_page = $result['parent_id'];
示例6: connection
function list_cats($config)
{
if (!empty($config['title'])) {
$title = $config['title'];
} else {
$title = 'Kategorien';
}
if (!empty($config['order_by'])) {
$order_by = $config['order_by'];
} else {
$order_by = 'title';
}
$db = new connection();
$list_cats = $db->query('SELECT * FROM object WHERE type="category" AND status=1 ORDER BY ' . $order_by);
echo "<div class='sidebar-item'>";
echo "<div class='sidebar-item-head'>{$title}</div>";
while ($cat = $db->fetch_array()) {
echo "<div class='sidebar-item-box'>";
echo "<div class='sidebar-item-box-head'><a href='./?cat={$cat['id']}' title='" . strip_tags(html_entity_decode($cat['content'])) . "'>{$cat['title']}</a></div>";
echo "</div>";
}
echo "</div>";
}
示例7: connection
echo "<div class='content-item-body'>" . html_entity_decode($frontpage['content']) . "</div>";
echo "</div>";
echo "</div>";
} else {
echo "<div class='content'>";
$db = new connection();
$max_per_page = 10;
$qs = $system->the_querystring();
if (isset($qs['last'])) {
$last = $qs['last'];
$query = $db->query("SELECT * FROM object WHERE type='post' AND status=1 AND id<{$last} ORDER BY id DESC LIMIT {$max_per_page}");
} else {
$query = $db->query("SELECT * FROM object WHERE type='post' AND status=1 ORDER BY id DESC LIMIT {$max_per_page}");
}
$i = 0;
while ($o = $db->fetch_array()) {
$obj = new dbobject($o['id']);
?>
<div class="content-item">
<div class="content-item-head"><a href="./?p=<?php
echo $obj->the_id();
?>
" rel="nofollow"><?php
echo $obj->the_title();
?>
</a></div>
<div class="content-item-head-secondary"><?php
echo $obj->the_cat($by_name = 1, $linked = 1);
示例8: connection
echo $feed['site_name'];
?>
> Updates</title>
<link><?php
echo $channel_url;
?>
</link>
<description><?php
echo $feed['site_description'];
?>
</description>
<?php
$db = new connection();
$db->query("SELECT * FROM object WHERE type='post' AND status=1 ORDER BY id DESC");
while ($row = $db->fetch_array()) {
$link = $item_url . "?p=" . $row['id'];
$title = htmlspecialchars(html_entity_decode($row['title']));
$content = htmlspecialchars(html_entity_decode($row['content']));
$pubDate = $row['date'];
$pubDate = gmdate("Y-m-d\\TH:i:s\\Z", $pubDate);
?>
<item>
<title><?php
echo $title;
?>
</title>
<link><?php
echo $link;
?>
</link>
示例9: htmlentities
if (isset($cat_id)) {
if (isset($last)) {
$query = $db->query("SELECT * FROM object WHERE type='post' AND status=1 AND id<{$last} AND cat='{$cat_id}' ORDER BY id DESC LIMIT {$max_per_page}");
} else {
$query = $db->query("SELECT * FROM object WHERE type='post' AND status=1 AND cat='{$cat_id}' ORDER BY id DESC LIMIT {$max_per_page}");
}
}
if (isset($tag)) {
if (isset($last)) {
$query = $db->query("SELECT * FROM object WHERE type='post' AND status=1 AND id<{$last} AND keywords LIKE '%" . htmlentities($tag) . "%' ORDER BY id DESC LIMIT {$max_per_page}");
} else {
$query = $db->query("SELECT * FROM object WHERE type='post' AND status=1 AND keywords LIKE '%" . htmlentities($tag) . "%' ORDER BY id DESC LIMIT {$max_per_page}");
}
}
$i = 0;
while ($result = $db->fetch_array()) {
$obj = new dbobject($result['id']);
//$obj->id = $result['id'];
echo '<div class="content-item">';
$the_title = $result['title'];
if ($result['type'] == 'page') {
echo "<div class='content-item-head'><a href='./?page_id={$result['id']}' rel='nofollow'>{$the_title}</a></div>";
} else {
echo "<div class='content-item-head'><a href='./?p={$result['id']}' rel='nofollow'>{$the_title}</a></div>";
}
?>
<div class="content-item-head-secondary"><?php
echo $obj->the_cat($by_name = 1, $linked = 1);
echo $obj->datetime();