本文整理汇总了PHP中get_result函数的典型用法代码示例。如果您正苦于以下问题:PHP get_result函数的具体用法?PHP get_result怎么用?PHP get_result使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_result函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index($language_id = 2)
{
$map = array('language_id' => $language_id);
$result = get_result('location_description', $map);
$continent = array();
$country = array();
$city = array();
$location_id = array();
foreach ($result as $row) {
if ($row['continent'] == '') {
continue;
}
$continent[$row['continent']] = $row['continent'];
$country[$row['continent']][] = $row['country'];
$city[$row['country']][] = $row['city'];
$location_id[$row['city']] = $row['location_id'];
}
$new_country = array();
foreach ($continent as $row) {
$new_country[$row] = array_unique($country[$row]);
}
$data['continent_json'] = json_encode($continent);
$data['country_json'] = json_encode($new_country);
$data['city_json'] = json_encode($city);
$data['location_id'] = json_encode($location_id);
$this->assign($data);
$this->display(T('Common@Widget/Location/index'));
}
示例2: index
public function index($product_id, $Month = '', $moudel = '')
{
if (!$product_id) {
$product_id = 0;
}
$map['product_id'] = $product_id;
$result = get_result('product_price', $map);
if ($Month) {
$Montht = $Month;
} else {
$Montht = date('Y-m-d');
}
$Monthts = date('t', strtotime($Montht));
foreach ($result as $k => $row) {
$data[] = array('id' => $row['id'], 'title' => $row['type1_price'], 'start' => date('Y-m-d', $row['day']), 'name' => date('Y-m-d H:i', $row['day']), 'textColor' => '#0FDECF');
}
for ($im = 1; $im <= $Monthts; $im++) {
$map['day'] = strtotime(date('Y-m-d', $row['day']));
$description_info = get_info('product_description', $map);
if ($description_info) {
$data[] = array('id' => $description_info['id'], 'title' => $row['type1_price'], 'start' => date('Y-m-d', $description_info['day']), 'name' => date('Y-m-d H:i', $description_info['day']), 'textColor' => '#0FDECF');
} else {
$data[] = array('id' => '0', 'title' => '设定价格', 'start' => date('Y-m', strtotime($Montht)) . "-" . $im, 'name' => date('Y-m', strtotime($Montht)) . "-" . $im, 'textColor' => '#0FDECF');
}
}
$datas['data'] = json_encode($data);
$this->assign($map);
$this->assign($datas);
$this->display(T('Common@Widget/ProductPrice/index'));
}
示例3: fetch_comments_unit
function fetch_comments_unit($unitId)
{
global $mysqli;
$sql = 'SELECT Comments.id, (DATE_FORMAT(commentTime, "%d.%m.%Y %H:%i:%s")) as time,name as user,comment, IFNULL(SUM(isPositive),0) as positive, IFNULL(COUNT(isPositive)-SUM(isPositive),0) as negative, CommentAnswers.answerTo as answerTo,
IFNULL((SELECT (isPositive-1)+isPositive FROM CommentRating WHERE id=Comments.id AND userId=?),0) as voted
FROM Comments
LEFT JOIN UserData
ON Comments.userId=UserData.Id
LEFT JOIN CommentRating
ON Comments.id=CommentRating.id
LEFT JOIN CommentAnswers
ON CommentAnswers.id=Comments.id
WHERE unitId=?
GROUP BY Comments.id';
$stmt = $mysqli->prepare($sql);
$stmt->bind_param('ii', $userId, $unitId);
$stmt->execute();
$result = array();
$comment = get_result($stmt);
while ($stmt->fetch()) {
$result[] = $comment;
$comment = get_result($stmt);
}
$stmt->fetch();
$stmt->close();
return $result;
}
示例4: read_invitations
function read_invitations()
{
global $TABLE_PREFIX, $admintpl, $language, $CURUSER, $STYLEPATH, $btit_settings;
$scriptname = htmlspecialchars($_SERVER["PHP_SELF"] . "?page=admin&user=" . $CURUSER["uid"] . "&code=" . $CURUSER["random"] . "&do=invitations");
$addparam = "";
$res = get_result("SELECT COUNT(*) as invites FROM {$TABLE_PREFIX}invitations", true);
$count = $res[0]["invites"];
list($pagertop, $pagerbottom, $limit) = pager('15', $count, $scriptname . "&");
$admintpl->set("inv_pagertop", $pagertop);
$admintpl->set("inv_pagerbottom", $pagerbottom);
$results = get_result("SELECT * FROM {$TABLE_PREFIX}invitations ORDER BY id DESC {$limit}", true);
$invitees = array();
$i = 0;
foreach ($results as $id => $data) {
$res = do_sqlquery("SELECT username FROM {$TABLE_PREFIX}users WHERE id = " . $data["inviter"], true);
if (mysql_num_rows($res) > 0) {
$inviter_name = mysql_result($res, 0, 0);
} else {
$inviter_name = 'Unknown';
}
$invitees[$i]["inviter"] = "<a href=\"index.php?page=userdetails&user=" . $data["inviter"] . "\">" . $inviter_name . "</a>";
$invitees[$i]["invitee"] = unesc($data["invitee"]);
$invitees[$i]["hash"] = unesc($data["hash"]);
$invitees[$i]["time_invited"] = $data["time_invited"];
$invitees[$i]["delete"] = "<a href=\"index.php?page=admin&user=" . $CURUSER["uid"] . "&code=" . $CURUSER["random"] . "&do=invitations&action=delete&id=" . $data["id"] . "\" onclick=\"return confirm('" . AddSlashes($language["DELETE_CONFIRM"]) . "')\">" . image_or_link("{$STYLEPATH}/images/delete.png", "", $language["DELETE"]) . "</a>";
$i++;
}
$admintpl->set("invitees", $invitees);
$admintpl->set("language", $language);
}
示例5: index
public function index($currency = '')
{
$data['result'] = get_result('currency');
$data['currency'] = $currency;
$this->assign($data);
$this->display(T('Common@Widget/Currency/index'));
}
示例6: index
/**
*帮助中心主页
* 显示关于N邦的帮助文章
*流程分析
* 1、将页面中的菜单查询出来并显示
* 2、要求是用户在后台添加的时候前台能够自动显示出来菜单并显示到页面中
**/
public function index()
{
$article_id = I('id');
/* 获取分类列表 */
$help_category_cath = array_id_key(get_help_category_cache());
$category_ids = array();
foreach ($help_category_cath as $row) {
$category_ids[] = $row['id'];
}
/* 获取分类下的所有文章 */
$map = null;
$map['status'] = 1;
$map['category_id'] = array('in', $category_ids);
$articles = get_result($this->table, $map);
/* 获去当前显示的文章 */
if ($article_id) {
$map['id'] = $article_id;
$map['status'] = 1;
$cur_article = get_info($this->table, $map);
} else {
$cur_article = $articles[0];
}
$data['help_category_cath'] = $help_category_cath;
$data['articles'] = $articles;
$data['cur_article'] = $cur_article;
$this->assign($data);
$this->display();
}
示例7: ca_mois
function ca_mois($mois, $annee, $jour, $pourc = 100, $port = 1)
{
global $cnx;
if ($jour != "%") {
$jour = sprintf("%02d", $jour);
}
if ($mois != "%") {
$mois = sprintf("%02d", $mois);
}
if ($annee != "%") {
$annee = sprintf("%04d", $annee);
}
$date = "{$annee}-{$mois}-{$jour}";
$query = "select * from " . Commande::TABLE . " where statut >= " . Commande::PAYE . " and statut <> " . Commande::ANNULE . " and datefact like '{$date}'";
$resul = $cnx->query($query);
$list = array();
while ($resul && ($row = $cnx->fetch_object($resul))) {
$list[] = $row->id;
}
if (count($list) == 0) {
$list = '0';
} else {
$list = implode(',', $list);
}
$ca = round(get_result("SELECT sum(quantite*prixu) as camois FROM " . Venteprod::TABLE . " where commande in ({$list})"), 2);
$ca += get_result("SELECT sum(port) as port FROM " . Commande::TABLE . " where id in ({$list})");
$ca -= get_result("SELECT sum(remise) as remise FROM " . Commande::TABLE . " where id in ({$list})");
if (!$port) {
$ca -= get_result("SELECT sum(port) as port FROM " . Commande::TABLE . " where id in ({$list})");
}
return round($ca * $pourc / 100, 2);
}
示例8: index
/**
*我的脚印
* 显示店铺经营的一些数据统计
* 1、店铺中交易成功的金额
* 2、翻译的字数统计
* 3、口译小时数统计
* 4、音频翻译分钟数统计
**/
public function index()
{
$apptype = (!empty(I('post.apptype')) and I('post.apptype') == C('APP_KEY')) ? true : false;
//手机app接口密钥
if ($apptype) {
$app_key = trim(I("post.key"));
//md5加密的登录时间
$member_id = I("post.home_member_id");
$this->isLoginExpire($app_key, $member_id);
//判断登录过期
} else {
$member_id = session('home_member_id');
}
//查询出来属于这个店铺的订单的数据
//$map['member_id'] = $member_id;
$map = array('member_id' => $member_id, 'status' => array(in, array(3, 6, 7)));
$shop_order_data = get_result($this->table, $map);
//处理数据
$shop_data = $this->shop_data($shop_order_data);
if ($apptype) {
$this->ajaxReturn($shop_data);
}
$this->assign($shop_data);
$this->display();
}
示例9: view
public function view()
{
if (!isset($_SESSION["autorised"])) {
header('Location: ' . $_SESSION['base_url'] . '/home');
}
include_once "/../models/model_test.php";
$result = get_result(-1, $_SESSION['user_id']);
include_once "/../pages/result.php";
}
示例10: completedProjectDetailofUser
public function completedProjectDetailofUser($userid, $from, $to)
{
global $dblink;
$v = $dblink->prepare("SELECT * FROM project WHERE userid=? AND status='1' ORDER BY id DESC LIMIT ?,?");
$v->bind_param("iii", $userid, $from, $to);
$v->execute();
$data = get_result($v);
return $data;
}
示例11: search
public function search($emailid)
{
global $dblink;
$v = $dblink->prepare("SELECT * FROM user WHERE email=? or username=?");
$v->bind_param("ss", $emailid, $emailid);
$v->execute();
$result = get_result($v);
return $result;
}
示例12: getUserInfo
private function getUserInfo($id)
{
global $dblink;
$v = $dblink->prepare("SELECT * FROM user WHERE id=?");
$v->bind_param("i", $id);
$v->execute();
$result = get_result($v);
return $result;
}
示例13: index
public function index($action, $parameter = array(), $language_id = '')
{
$data['result'] = get_result('language');
$data['action'] = $action;
$data['parameter'] = $parameter;
$data['language_id'] = $language_id;
$this->assign($data);
$this->display(T('Common@Widget/Language/index'));
}
示例14: listBidsforUser
public function listBidsforUser($userid, $from, $to)
{
global $dblink;
$v = $dblink->prepare("SELECT * FROM project_bid WHERE userid=? ORDER BY ID DESC LIMIT ?,?");
$v->bind_param("iii", $userid, $from, $to);
$v->execute();
$result = get_result($v);
return $result;
}
示例15: listar
public function listar($cod_situacao = null)
{
$query = $this->query();
if (!is_null($cod_situacao)) {
$query .= " WHERE cod_situacao = '" . do_escape($cod_situacao) . "' ";
}
$query .= " ORDER BY nome ";
return get_result($query);
}