本文整理汇总了PHP中database::fetcharray方法的典型用法代码示例。如果您正苦于以下问题:PHP database::fetcharray方法的具体用法?PHP database::fetcharray怎么用?PHP database::fetcharray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类database
的用法示例。
在下文中一共展示了database::fetcharray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: activity
$_SESSION['dateline'] = $dateline;
$_SESSION['created'] = $created;
// Log the activity
$action = new activity();
$action->track_activity($userID, $action->saving_article, 'Saving the article ' . $_SESSION['title']);
$gotoURL = "../admin/my_articles2.php";
}
}
break;
case 'submit2editor':
if (isset($articletask)) {
$currenttime = time();
$sql = "select * from tasks where taskID = '{$articletask}' ";
$db->query($sql);
$gettask = array();
while ($gettask[] = $db->fetcharray()) {
}
$duedate = $gettask[0]->enddate;
if ($db->getnumrows() > 0) {
if ($currenttime > $duedate) {
echo '<script>alert("Sorry, the article is no longer accepted because you haven\'t met the deadline of this task which is ' . friendlydate5($duedate) . '. If you really want to submit the article kindly contact the editor.");</script>';
echo '<script>history.go(-1);</script>';
exit;
} else {
$sql = "update tasks set status = 'Completed' where taskID = '{$articletask}' ";
$db->query($sql);
}
}
}
if (isset($_SESSION['articleID'])) {
$created = $_SESSION['created'];
示例2: unset
unset($_SESSION['title']);
unset($_SESSION['article_body']);
unset($_SESSION['dateline']);
unset($_SESSION['created']);
unset($_SESSION['edited_by']);
}
/**
* Get all the tasks
*/
$sql = " select * from tasks where assignedto = '{$userID}' \r\n\t\tand status != 'Completed' ";
if (!($result = $db->query($sql))) {
die('Error:' . $db->error());
}
//echo $sql;
$tasks = array();
while ($row = $db->fetcharray()) {
$tasks[] = $row;
}
$db->freeresult();
$tasklist = '';
foreach ($tasks as $field => $data) {
$tasklist .= '<option value="' . $data->taskID . '">';
$tasklist .= $data->subject;
$tasklist .= '</option>';
}
/**
* Get all the news category
*/
$sql = " select * from category ";
if (!($result = $db->query($sql))) {
die('Error:' . $db->error());
示例3: die
case 6:
// whos yur daddy...
$sql = " select * from article_versions av ";
$sql .= " where av.stageID = " . $_SESSION['stageID'];
$sql .= " and av.isarchive = '1' ";
$sql .= " order by dateline DESC ";
$heading = "News Content Archive Manager";
break;
}
}
//print $sql;
if (!($result = $db->query($sql))) {
die('Error:' . $db->error());
}
$my_articles = array();
while ($row = $db->fetcharray()) {
$my_articles[] = $row;
}
$n = $db->getnumrows();
$db->freeresult();
//print_r($my_articles);
$totalrows = count($my_articles);
$limit = 10;
$paging = ceil($totalrows / $limit);
$scroll = 1;
$scrollnumber = 5;
if (isset($_GET['page'])) {
$page = $_GET['page'];
} else {
$page = 1;
}
示例4: database
if ( !isset($_SESSION['login'])) {
header('Location: login.php');
}
if (isset($_SESSION['login'])) {
$userID = $_SESSION['userID'];
$usertype = $_SESSION['usertype'];
}
*/
$db = new database();
$sql = "select * from content_users ";
if (!($result = $db->query($sql))) {
die('Error:' . $db->error());
}
$content_users = array();
while ($content_users[] = $db->fetcharray()) {
}
$db->freeresult();
for ($i = 0; $i < count($content_users) - 1; $i++) {
$i % 2 == 0 ? $bgcolor = "" : ($bgcolor = "#F5F5F5");
$row_data .= '<tr class="tdhover" bgcolor = "' . $bgcolor . '" align = "center">';
$row_data .= '<td align="left">';
$row_data .= $content_users[$i]->fullname;
$row_data .= '</td>';
$row_data .= '<td>';
$row_data .= $content_users[$i]->username;
$row_data .= '</td>';
$row_data .= '<td>';
$row_data .= '<label>';
$row_data .= $content_users[$i]->is_loggedin;
$row_data .= '</label>';
示例5: makeRelativePath
} else {
$ads148x300 .= '<p><a href="' . $PHP_SELF . '?bannerID=' . $bannerdata->bannerID . '">';
$ads148x300 .= '<img src="' . makeRelativePath($bannerdata->banner_imageurl, 7) . '" border="0" width="130" ></a>';
$ads148x300 .= '</p>';
}
}
/**
* Get the sponsored links.., esp. the active clients
*/
$sql = " select website from corporate_partners cp ";
$sql .= " where cp.status = '1' ";
if (!($result = $db->query($sql))) {
die('Error:' . $db->error());
}
$links = array();
while ($links[] = $db->fetcharray()) {
}
$db->freeresult();
$sponsoredlinks = '';
$n = count($links) - 1;
for ($i = 0; $i < $n; $i++) {
// Count the active banners
foreach ($links as $field => $values) {
if ($field == 'clientID') {
if (checkhttptext($links[$i]->website)) {
$url = splithttptext($links[$i]->website);
$sponsoredlinks .= '<li><a href="' . $links[$i]->website . '">' . $url[1] . '</a></li>';
} else {
$sponsoredlinks .= '<li><a href="http://' . $links[$i]->website . '">' . $links[$i]->website . '</a></li>';
}
}
示例6: task
$message = 'Successfully saved the tasks: ' . $_SESSION['title'];
break;
case 'delete':
$message = 'Successfully delete the task(s) ';
break;
}
unset($_SESSION['task']);
}
$db = new database();
$created = simpledate(time());
$sql = "select * from tasks order by created_t desc";
if (!($result = $db->query($sql))) {
die('Error:' . $db->error());
}
$tasks = array();
while ($tasks[] = $db->fetcharray()) {
}
$totalrows = count($tasks);
$limit = 10;
$paging = ceil($totalrows / $limit);
$scroll = 0;
$scrollnumber = 5;
if (isset($_GET['page'])) {
$page = $_GET['page'];
} else {
$page = 1;
}
$start = $page * $limit - $limit;
$pagelink = new paging($page, $totalrows, $limit, $paging, $scroll, $scrollnumber);
$j = $start + 1;
for ($i = $start; $i < $start + $limit; $i++) {
示例7: unset
break;
case 'add':
$message = 'Successfully saved client: ' . $_SESSION['title'];
break;
default:
$message = '';
break;
}
unset($_SESSION['task']);
}
$sql = " select * from corporate_partners order by registerDate desc ";
if (!($result = $db->query($sql))) {
die('Error:' . $db->error());
}
$clients = array();
while ($clients[] = $db->fetcharray()) {
}
//print_r($clients);
$totalrows = count($clients);
$limit = 10;
$paging = ceil($totalrows / $limit);
$scroll = 1;
$scrollnumber = 5;
if (isset($_GET['page'])) {
$page = $_GET['page'];
} else {
$page = 1;
}
$start = $page * $limit - $limit;
$pagelink = new paging($page, $totalrows, $limit, $paging, $scroll, $scrollnumber);
$j = $start + 1;
示例8: header
session_start();
// if user is not login..redirect him to login page
if (!isset($_SESSION['login'])) {
header('Location: login.php');
}
if (isset($_SESSION['login'])) {
$userID = $_SESSION['userID'];
$usertype = $_SESSION['usertype'];
}
$db = new database();
$sql = " select * from user_log ";
if (!($result = $db->query($sql))) {
die('Error :' . $db->error());
}
$user_log = array();
while ($user_log[] = $db->fetcharray()) {
}
$db->freeresult();
for ($i = 0; $i < count($user_log) - 1; $i++) {
$i % 2 == 0 ? $bgcolor = "" : ($bgcolor = "#F5F5F5");
$row_data .= '<tr class="tdhover" id="tdata" bgcolor = "' . $bgcolor . '" align = "center">';
$row_data .= '<td align="left">';
$row_data .= '<a href="' . VIEW_PROFILE_URL . $user_log[$i]->userID . '">';
//$row_data .= '<input type="hidden" value = "' . $user_log[$i]->userID . '">';
$user_fullname = getUser_info($user_log[$i]->userID, 'fullname');
$row_data .= $user_fullname;
$row_data .= $user_log[$i]->fullname;
$row_data .= '</a>';
$row_data .= '</td>';
$row_data .= '<td>';
$username = getUser_info($user_log[$i]->userID, 'username');
示例9: unset
$userID = $_SESSION['userID'];
$usertype = $_SESSION['usertype'];
}
if (isset($_SESSION['message'])) {
$message = $_SESSION['message'];
unset($_SESSION['message']);
}
$quotaID = $_GET['quotaID'];
$_SESSION['quotaID'] = $quotaID;
$db = new database();
$sql = " select * from quota where quotaID='{$quotaID}' ";
if (!($result = $db->query($sql))) {
die('Error:' . $db->error());
}
$quota = array();
if ($quota[] = $db->fetcharray()) {
}
$db->freeresult();
$myquota = $quota[0]->quota;
if ($quota[0]->isdefault) {
$optyesno .= '<input name="isdefault" type="radio" value="1" checked>Yes';
$optyesno .= '<input name="isdefault" type="radio" value="0" >No';
} else {
$optyesno .= '<input name="isdefault" type="radio" value="1" >Yes';
$optyesno .= '<input name="isdefault" type="radio" value="0" checked >No';
}
// Log the activity
$action = new activity();
$action->track_activity($userID, $action->creating_category, '-');
// ok baby, let start compiling the page now..go! go! go! {mh}
$tpl = new template_parser('../templates/edit_quota.tpl.php');
示例10: die
if ( $field == 'articleID' ) {
$other_headlines .= '<li><a href="view_article.php?articleID=' . $other_headlinenews[$i]->articleID . '">' . $other_headlinenews[$i]->title . '</a>';
$other_headlines .= '</li>';
}
}
}
*/
/**
* obtain list of the category
*/
$sql = "select * from category order by category_name ASC";
if (!($result = $db->query($sql))) {
die('Error:' . $db->error());
}
$categories = array();
while ($categories[] = $db->fetcharray()) {
}
$totalcategories = count($categories);
$categorylist = '';
for ($i = 0; $i < $totalcategories - 1; $i++) {
foreach ($categories as $field => $value) {
if ($field == 'category_name') {
$categorylist .= '<li><a href="' . VIEW_CATEGORY_URL . $categories[$i]->categoryID . '">' . $categories[$i]->category_name . '</a></li>';
}
}
}
/**
* Get the set of images of the article...( its better to have 1 image per article,, ok na!!)
*/
$imagesets = getArticle_imageSets($view_article[0]->articleID);
if (count($imagesets) > 1) {
示例11: database
$db = new database();
$x = new online_tracker();
$x->tracker();
$gerger = new gerger_timer();
$gerger->start();
$gerger->setprecision(4);
/**
* obtain list of all client ads, images
*/
$sql = " select * from corporate_partners_imgs ";
$sql .= " where banner_show = '1' ";
if (!($result = $db->query($sql))) {
die('Error:' . $db->error());
}
$alladvertisements = array();
while ($alladvertisements[] = $db->fetcharray()) {
}
$ads = '';
for ($i = 0; $i < count($alladvertisements) - 1; $i++) {
foreach ($alladvertisements as $field => $value) {
if ($field == 'bannerID') {
if (checkhttptext($alladvertisements[$i]->banner_clickURL)) {
$ads .= '<div id= "banner_imgs" >';
$ads .= '<a href="' . $alladvertisements[$i]->banner_clickURL . '" >';
$ads .= '<img src= "' . makeRelativepath($alladvertisements[$i]->banner_imageurl, 7) . '" border="0" ></a>';
$ads .= '</div>';
} else {
$ads .= '<div id= "banner_imgs" >';
$ads .= '<a href="http://' . $alladvertisements[$i]->banner_clickURL . '" >';
$ads .= '<img src= "' . makeRelativepath($alladvertisements[$i]->banner_imageurl, 7) . '" border="0" ></a>';
$ads .= '</div>';
示例12: header
session_start();
// if user is not login..redirect him to login page
if (!isset($_SESSION['login'])) {
header('Location: ../index.php');
}
$bannerID = $_GET['bannerID'];
$_SESSION['bannerID'] = $bannerID;
$clientID = $_SESSION['clientID'];
//print_r($_SESSION);
$db = new database();
$sql = " select * from corporate_partners_imgs cp ";
$sql .= " where cp.bannerID=" . intval($bannerID);
if (!($result = $db->query($sql))) {
die('Error:' . $db->error());
}
while ($cpimages[] = $db->fetcharray()) {
}
$sql = " select * from corporate_partners_imgs cp , stockphotos s \r\n where cp.banner_clientID= {$clientID}\r\n and s.imageID=cp.imageID ";
if (!($result = $db->query($sql))) {
die('Error:' . $db->error());
}
$ads = array();
while ($ads[] = $db->fetcharray()) {
}
/**
* Populate all the corporate partners into an array..
*/
$bannerurl = '';
for ($i = 0; $i < count($ads); $i++) {
foreach ($ads as $field => $data) {
if ($field == 'bannerID') {
示例13: database
<?php
require 'admin/coreclass.php';
$db = new database();
$x = new online_tracker();
$x->tracker();
$gerger = new gerger_timer();
$gerger->start();
$gerger->setprecision(4);
$sql = " select * from other_site_content where status='Published' and id=2 order by created desc ";
if (!($result = $db->query($sql))) {
die('Error:' . $db->error());
}
$about = array();
while ($about[] = $db->fetcharray()) {
}
$db->freeresult();
$title = $about[0]->title;
$body = $about[0]->body;
/*
* Get the default stylesheets
*/
include 'admin/template.configuration.php';
$stylesheet = ' themes/' . $default_template_name . '/' . $default_template_stylesheet;
$db->close();
$gerger->stop();
$pagegenerated = $gerger->display();
// Generate the page now
$tpl = new template_parser('themes/templates/aboutus2.tpl.php');
$tags = array('{TITLE}' => $title, '{BODY}' => $body, '{PAGE_GENERATED}' => ' ' . $pagegenerated, '{FOOTER}' => 'themes/templates/footer.tpl.php', '{STYLESHEET}' => $stylesheet);
$tpl->parse_template($tags);
示例14: quota
case 'add':
$message = 'Successfully saved the quota: ' . $_SESSION['title'];
break;
case 'delete':
$message = 'Successfully delete the quota(s)';
break;
}
unset($_SESSION['task']);
}
$db = new database();
$sql = " select * from quota order by quota asc";
if (!($result = $db->query($sql))) {
die('Error:' . $db->error());
}
$quota = array();
while ($quota[] = $db->fetcharray()) {
}
$totalrows = count($quota);
$limit = 10;
$paging = ceil($totalrows / $limit);
$scroll = 1;
$scrollnumber = 5;
if (isset($_GET['page'])) {
$page = $_GET['page'];
} else {
$page = 1;
}
$start = $page * $limit - $limit;
$pagelink = new paging($page, $totalrows, $limit, $paging, $scroll, $scrollnumber);
$j = $start + 1;
for ($i = $start; $i < $start + $limit; $i++) {
示例15: header
if (!isset($_SESSION['login'])) {
header('Location: ../index.php');
}
//print_r($_SESSION);
//print_r($_POST);
unset($_SESSION['imageID']);
// remove pre-existing sessions
unset($_SESSION['bannerID']);
$clientID = $_SESSION['clientID'];
$db = new database();
$sql = " select * from corporate_partners_imgs cp , stockphotos s \r\n where cp.banner_clientID= {$clientID}\r\n and s.imageID=cp.imageID ";
if (!($result = $db->query($sql))) {
die('Error:' . $db->error());
}
$ads = array();
while ($ads[] = $db->fetcharray()) {
}
/**
* Populate all the corporate partners into an array..
*/
$bannerurl = '';
for ($i = 0; $i < count($ads); $i++) {
foreach ($ads as $field => $data) {
if ($field == 'bannerID') {
$imgurl = $ads[$i]->banner_imageurl;
$bannerurl .= '<option value="' . $imgurl . '">';
//$bannerurl .= '<option value="' . $ads[$i]->imageID . '">';
$bannerurl .= makeRelativePath($imgurl, 9);
$bannerurl .= '</option>';
}
}