本文整理汇总了PHP中DBConnection::fetch_assoc方法的典型用法代码示例。如果您正苦于以下问题:PHP DBConnection::fetch_assoc方法的具体用法?PHP DBConnection::fetch_assoc怎么用?PHP DBConnection::fetch_assoc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBConnection
的用法示例。
在下文中一共展示了DBConnection::fetch_assoc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getwebsitepages
function getwebsitepages($websiteid)
{
$viewpage = new Website();
$res = $viewpage->fetchwebpages($websiteid);
$db = new DBConnection();
$pagearr = array();
$count = 0;
while ($pagerow = $db->fetch_assoc($res)) {
if (empty($pagecontent)) {
$pagearr[$count] = $pagerow['page_id'];
$count++;
}
}
return $pagearr;
}
示例2: Page
<?php
include_once "header.php";
include_once 'includes/page.php';
session_start();
$_SESSION['username'] = 'sachin';
$_SESSION['userid'] = 2;
if (isset($_GET['pageurlid'])) {
$pageid = $_GET['pageurlid'];
$viewpage = new Page();
$Type = 'bypage';
if (isset($_GET['pageurlid'])) {
$res = $viewpage->Fetchpageinfo($pageid, $Type);
$db = new DBConnection();
$pagerow = $db->fetch_assoc($res);
$pageid = $pagerow['page_id'];
$pagename = $pagerow['page_name'];
$pagecontent = $pagerow['page_content'];
}
}
?>
<!-- BEGIN: Page Content -->
<title><?php
echo $pagename;
?>
<title>
<div id="container">
<div id="content">
<h2> <?php
echo $pagecontent;
?>
示例3: Website
<?php
include_once "header.php";
include_once 'includes/website.php';
include_once 'includes/library.php';
session_start();
$_SESSION['websiteid'] = 1;
$websiteid = $_SESSION['websiteid'];
$viewpage = new Website();
$res = $viewpage->fetchpage($websiteid, $pageid = 0);
$db = new DBConnection();
$items = array();
$i = 1;
while ($pagerow = $db->fetch_assoc($res)) {
// print_r($pagerow);
$items[$i] = $pagerow['page_id'];
$i++;
}
if (isset($_GET['pageurlid'])) {
$pageid = Mod_addslashes($_GET['pageurlid']);
$websiteid = $_SESSION['websiteid'];
$website = new Website();
/***********for fetching particular page information *************/
$res = $website->fetchpage($websiteid, $pageid);
$pagerow = $website->fetch_assoc($res);
//print_r($pagerow);
$pageid = $pagerow['page_id'];
$pagename = $pagerow['page_name'];
$pagecontent = $pagerow['page_content'];
}
/******* fetching website information ***************/