• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP pdo_fetchall函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中pdo_fetchall函数的典型用法代码示例。如果您正苦于以下问题:PHP pdo_fetchall函数的具体用法?PHP pdo_fetchall怎么用?PHP pdo_fetchall使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了pdo_fetchall函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: doWebList

 public function doWebList()
 {
     global $_W, $_GPC;
     $table = 'p_room';
     $Room = trim($_GPC['Room']);
     $status = trim($_GPC['status']);
     $sel_build = trim($_GPC['build']);
     $project = biz_unserializer($_W['project'], 'builds');
     $build = db_getBuilds($_W['project']['projguid'], '', !empty($project));
     //$default = 0;
     $condition = " WHERE ProjGUID=:ProjGUID ";
     $param = array(":ProjGUID" => $_W['project']['projguid']);
     if (!empty($Room)) {
         $condition .= " AND Room LIKE '%{$Room}%' ";
         $_GET['Room'] = $_GPC['Room'];
     }
     if (!empty($status)) {
         $condition .= " AND Status LIKE '%{$status}%' ";
         $_GET['status'] = $_GPC['status'];
     }
     if (!empty($sel_build)) {
         $condition .= " AND BldGUID=:BldGUID ";
         $param[':BldGUID'] = $sel_build;
         $_GET['build'] = $sel_build;
     }
     $pindex = max(1, intval($_GPC['page']));
     $psize = 20;
     $sql = "SELECT * FROM " . tablename($table) . $condition;
     $sql .= " order by RoomCode limit " . ($pindex - 1) * $psize . "," . $psize;
     $list = pdo_fetchall($sql, $param);
     $total = pdo_fetchcolumn(" select count(*) from " . tablename($table) . $condition, $param);
     $pager = pagination($total, $pindex, $psize);
     include $this->template('build_list');
 }
开发者ID:ruige123456,项目名称:dataMining,代码行数:34,代码来源:site.php


示例2: respond

 public function respond()
 {
     global $_W;
     $content = $this->message['content'];
     //这里定义此模块进行消息处理时的具体过程, 请查看WORMWOOD文档来编写你的代码
     $isfill = pdo_fetchcolumn("SELECT isfill FROM " . tablename('feng_testingreply') . " WHERE rid =:rid AND testingid = '0'", array(':rid' => $this->rule));
     $reply = pdo_fetchall("SELECT * FROM " . tablename('feng_testingreply') . " WHERE rid = :rid", array(':rid' => $this->rule));
     if (!empty($reply)) {
         foreach ($reply as $row) {
             $ids[$row['testingid']] = $row['testingid'];
         }
         $article = pdo_fetchall("SELECT id,title,photo,smalltext FROM " . tablename('feng_testing') . " WHERE id IN (" . implode(',', $ids) . ")", array(), 'id');
     }
     if ($isfill && ($count = 8 - count($reply)) > 0) {
         $articlefill = pdo_fetchall("SELECT id,title,photo,smalltext FROM " . tablename('feng_testing') . " WHERE weid = '{$_W['weid']}' AND id NOT IN (" . implode(',', $ids) . ") ORDER BY id DESC LIMIT {$count}", array(), 'id');
         if (!empty($articlefill)) {
             foreach ($articlefill as $row) {
                 $article[$row['id']] = $row;
                 $reply[]['testingid'] = $row['id'];
             }
             unset($articlefill);
         }
     }
     if (!empty($reply)) {
         $response = array();
         foreach ($reply as $row) {
             $row = $article[$row['testingid']];
             if (!empty($row)) {
                 $response[] = array('title' => $row['title'], 'description' => $row['description'], 'picurl' => $row['thumb'], 'url' => $this->buildSiteUrl($this->createMobileUrl('detail', array('id' => $row['id']))));
             }
         }
     }
     return $this->respNews($response);
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:34,代码来源:processor.php


示例3: getCategory

 public function getCategory()
 {
     global $_W;
     $shopset = m('common')->getSysset('shop');
     $allcategory = array();
     $category = pdo_fetchall("SELECT * FROM " . tablename('ewei_shop_category') . " WHERE uniacid=:uniacid and enabled=1 ORDER BY parentid ASC, displayorder DESC", array(':uniacid' => $_W['uniacid']));
     $category = set_medias($category, array('thumb', 'advimg'));
     foreach ($category as $c) {
         if (empty($c['parentid'])) {
             $children = array();
             foreach ($category as $c1) {
                 if ($c1['parentid'] == $c['id']) {
                     if (intval($shopset['catlevel']) == 3) {
                         $children2 = array();
                         foreach ($category as $c2) {
                             if ($c2['parentid'] == $c1['id']) {
                                 $children2[] = $c2;
                             }
                         }
                         $c1['children'] = $children2;
                     }
                     $children[] = $c1;
                 }
             }
             $c['children'] = $children;
             $allcategory[] = $c;
         }
     }
     return $allcategory;
 }
开发者ID:ChainBoy,项目名称:wxfx,代码行数:30,代码来源:shop.php


示例4: doMobileprivilege

 public function doMobileprivilege()
 {
     global $_GPC, $_W;
     $id = intval($_GPC['id']);
     $volist = pdo_fetchall("SELECT * FROM " . tablename('market_privilege') . " WHERE  weid=:weid and id=:id", array(':id' => $id, ':weid' => $_W['weid']));
     include $this->template('privilege');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:7,代码来源:site.php


示例5: doWebCategory

 public function doWebCategory()
 {
     global $_GPC, $_W;
     $op = !empty($_GPC['op']) ? $_GPC['op'] : 'display';
     $id = intval($_GPC['id']);
     if ($op == 'post') {
         if (!empty($id)) {
             $item = pdo_fetch("SELECT * FROM" . tablename('xfmarket_category') . "WHERE id='{$id}'");
         }
         if ($_W['ispost']) {
             $data = array('weid' => $_W['weid'], 'name' => $_GPC['cname'], 'enabled' => $_GPC['enabled']);
             if (empty($id)) {
                 pdo_insert('xfmarket_category', $data);
             } else {
                 pdo_update('xfmarket_category', $data, array('id' => $id));
             }
             message('更新成功', referer(), 'success');
         }
     } elseif ($op == 'display') {
         $row = pdo_fetchall("SELECT * FROM" . tablename('xfmarket_category') . "WHERE weid='{$_W['weid']}'");
     }
     if (checksubmit('delete')) {
         pdo_delete('xfmarket_category', " id  IN  ('" . implode("','", $_GPC['select']) . "')");
         message('删除成功', referer(), 'success');
     }
     include $this->template('category');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:27,代码来源:site.php


示例6: doMobileshow

 public function doMobileshow()
 {
     global $_W, $_GPC;
     $rid = $_GPC['id'];
     $sql = "SELECT * FROM " . tablename($this->tablename_log) . " WHERE `rid`=:rid";
     $info = pdo_fetchall($sql, array(':rid' => $rid));
     $sql = "SELECT * FROM " . tablename($this->tablename) . " WHERE `rid`=:rid LIMIT 1";
     $quiz = pdo_fetch($sql, array(':rid' => $rid));
     $sql = "SELECT * FROM " . tablename($this->tablename_question) . " WHERE `id`=:id";
     $q = pdo_fetch($sql, array(':id' => $quiz['qid']));
     //var_dump($q);
     $arr = array();
     foreach ($info as $key => $value) {
         $arr[] = $info[$key]['chk_answer'];
     }
     $per = array_count_values($arr);
     ksort($per);
     //var_dump($per);
     $total_count = sizeof($info);
     $config = $this->get_config($q);
     //foreach($per as $key => $value){
     //$str .= '选项'.$key.'次数'.$value;
     //}
     //var_dump($str);
     //var_dump($per);
     include $this->template('show');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:27,代码来源:site.php


示例7: site_article

function site_article($params = array())
{
    global $_GPC, $_W;
    extract($params);
    $pindex = max(1, intval($_GPC['page']));
    $psize = 20;
    $result = array();
    $condition = " WHERE weid = '{$_W['weid']}'";
    if (!empty($cid)) {
        $category = pdo_fetch("SELECT parentid FROM " . tablename('category') . " WHERE id = '{$cid}'");
        if (!empty($category['parentid'])) {
            $condition .= " AND ccate = '{$cid}'";
        } else {
            $condition .= " AND pcate = '{$cid}'";
        }
    }
    if ($iscommend == 'true') {
        $condition .= " AND iscommend = '1'";
    }
    if ($ishot == 'true') {
        $condition .= " AND ishot = '1'";
    }
    $sql = "SELECT * FROM " . tablename('article') . $condition . ' ORDER BY displayorder DESC, id DESC';
    $result['list'] = pdo_fetchall($sql . " LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
    $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('article') . $condition);
    $result['pager'] = pagination($total, $pindex, $psize);
    if (!empty($result['list'])) {
        foreach ($result['list'] as &$row) {
            $row['url'] = create_url('mobile/module/hdetail', array('name' => 'shouse', 'id' => $row['id'], 'weid' => $_W['weid']));
        }
    }
    return $result;
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:33,代码来源:model.php


示例8: doWebList

 public function doWebList()
 {
     global $_GPC, $_W;
     checklogin();
     $weid = $_W['account']['weid'];
     //当前公众号ID
     $id = intval($_GPC['id']);
     $condition = '';
     if (!empty($_GPC['name'])) {
         $condition .= " AND ( grabername LIKE '%{$_GPC['realname']}%' OR fitername LIKE '%{$_GPC['realname']}%' )";
     }
     if (!empty($_GPC['mobile'])) {
         $condition .= " AND ( grabermobile = '{$_GPC['mobile']}' OR fitermobile = '{$_GPC['mobile']}' )";
     }
     if (checksubmit('delete')) {
         pdo_delete('grabseat_record', " id IN ('" . implode("','", $_GPC['select']) . "')");
         message('删除成功!', $this->createWebUrl('list', array('id' => $id, 'page' => $_GPC['page'])));
     }
     if (!empty($_GPC['wid'])) {
         $wid = intval($_GPC['wid']);
         pdo_update('grabseat_record', array('status' => intval($_GPC['status'])), array('id' => $wid));
         message('标识领奖成功!', $this->createWebUrl('list', array('id' => $id, 'page' => $_GPC['page'])));
     }
     $pindex = max(1, intval($_GPC['page']));
     $psize = 25;
     $list = pdo_fetchall("SELECT * FROM " . tablename('grabseat_record') . " WHERE weid = '{$_W['weid']}' {$condition} ORDER BY id DESC LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
     $listtotal = pdo_fetchall("SELECT * FROM " . tablename('grabseat_record') . " WHERE weid = '{$_W['weid']}' {$condition} ");
     $total = count($listtotal);
     $pager = pagination($total, $pindex, $psize);
     include $this->template('list');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:31,代码来源:site.php


示例9: receive

 public function receive()
 {
     global $_W, $_GPC;
     load()->func('communication');
     $type = $this->message['type'];
     $uniacid = $GLOBALS['_W']['uniacid'];
     $acid = $GLOBALS['_W']['acid'];
     //$uniacid = $_W['acid'];
     $rid = intval($this->params['rule']);
     $rid = $this->rule;
     $openid = $this->message['fromusername'];
     $cfg = $this->module['config'];
     //file_put_contents(IA_ROOT.'/receive.txt', iserializer($cfg));
     if ($this->message['event'] == 'unsubscribe' && $cfg['isopenjsps']) {
         $record = array('updatetime' => TIMESTAMP, 'follow' => '0', 'followtime' => TIMESTAMP);
         pdo_update('mc_mapping_fans', $record, array('openid' => $openid, 'acid' => $acid, 'uniacid' => $uniacid));
         $fmvotelog = pdo_fetchall("SELECT * FROM " . tablename('fm_photosvote_votelog') . " WHERE from_user = :from_user and uniacid = :uniacid LIMIT 1", array(':from_user' => $openid, ':uniacid' => $uniacid));
         foreach ($fmvotelog as $log) {
             $fmprovevote = pdo_fetch("SELECT * FROM " . tablename('fm_photosvote_provevote') . " WHERE from_user = :from_user and uniacid = :uniacid LIMIT 1", array(':from_user' => $log['tfrom_user'], ':uniacid' => $uniacid));
             pdo_update('fm_photosvote_provevote', array('lasttime' => TIMESTAMP, 'photosnum' => $fmprovevote['photosnum'] - 1, 'hits' => $fmprovevote['hits'] - 1), array('from_user' => $log['tfrom_user'], 'uniacid' => $uniacid));
         }
         pdo_delete('fm_photosvote_votelog', array('from_user' => $openid));
         pdo_delete('fm_photosvote_bbsreply', array('from_user' => $openid));
     }
 }
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:25,代码来源:receiver.php


示例10: dolist

 public function dolist()
 {
     global $_GPC, $_W;
     checklogin();
     $weid = intval($_W['weid']);
     if (checksubmit('verify') && !empty($_GPC['select'])) {
         pdo_update('message_list', array('isshow' => 1, 'create_time' => TIMESTAMP), " id  IN  ('" . implode("','", $_GPC['select']) . "')");
         message('审核成功!', create_url('site/module', array('do' => 'list', 'name' => 'message', 'weid' => $weid, 'page' => $_GPC['page'])));
     }
     if (checksubmit('delete') && !empty($_GPC['select'])) {
         pdo_delete('message_list', " id  IN  ('" . implode("','", $_GPC['select']) . "')");
         message('删除成功!', create_url('site/module', array('do' => 'list', 'name' => 'message', 'weid' => $weid, 'page' => $_GPC['page'])));
     }
     $isshow = isset($_GPC['isshow']) ? intval($_GPC['isshow']) : 0;
     $pindex = max(1, intval($_GPC['page']));
     $psize = 20;
     $message = pdo_fetch("SELECT id, isshow, weid FROM " . tablename('message_reply') . " WHERE weid = '{$weid}' LIMIT 1");
     $list = pdo_fetchall("SELECT * FROM " . tablename('message_list') . " WHERE weid = '{$message['weid']}' AND isshow = '{$isshow}' ORDER BY create_time DESC LIMIT " . ($pindex - 1) * $psize . ",{$psize}");
     if (!empty($list)) {
         $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('message_list') . " WHERE weid = '{$message['weid']}' AND isshow = '{$isshow}'");
         $pager = pagination($total, $pindex, $psize);
         foreach ($list as &$row) {
             $row['content'] = emotion($row['content']);
             $userids[] = $row['from_user'];
         }
         unset($row);
     }
     include $this->template('list');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:29,代码来源:module.php


示例11: respond

 public function respond()
 {
     global $_W;
     $content = $this->message['content'];
     $from_user = $this->message['from'];
     $isfill = pdo_fetchcolumn("SELECT isfill FROM " . tablename('xc_article_article_reply') . " WHERE rid =:rid AND articleid = '0'", array(':rid' => $this->rule));
     $reply = pdo_fetchall("SELECT * FROM " . tablename('xc_article_article_reply') . " WHERE rid = :rid", array(':rid' => $this->rule));
     if (!empty($reply)) {
         foreach ($reply as $row) {
             $ids[$row['articleid']] = $row['articleid'];
         }
         $article = pdo_fetchall("SELECT id, title, thumb, content, description, linkurl FROM " . tablename('xc_article_article') . " WHERE id IN (" . implode(',', $ids) . ")", array(), 'id');
     }
     if ($isfill && ($count = 8 - count($reply)) > 0) {
         $articlefill = pdo_fetchall("SELECT id, title, thumb, content, description, linkurl FROM " . tablename('xc_article_article') . " WHERE weid = '{$_W['weid']}' AND id NOT IN (" . implode(',', $ids) . ") ORDER BY id DESC LIMIT {$count}", array(), 'id');
         if (!empty($articlefill)) {
             foreach ($articlefill as $row) {
                 $article[$row['id']] = $row;
                 $reply[]['articleid'] = $row['id'];
             }
             unset($articlefill);
         }
     }
     if (!empty($reply)) {
         $response = array();
         foreach ($reply as $row) {
             $row = $article[$row['articleid']];
             if (!empty($row)) {
                 $response[] = array('title' => htmlspecialchars_decode($row['title']), 'description' => htmlspecialchars_decode($row['description']), 'picurl' => $row['thumb'], 'url' => $this->buildSiteUrl($this->createMobileUrl('detail', array('id' => $row['id'], 'shareby' => $from_user, 'track_type' => 'click', 'linkurl' => $row['linkurl']))));
             }
         }
     }
     return $this->respNews($response);
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:34,代码来源:processor.php


示例12: doMobilelist

 public function doMobilelist()
 {
     global $_GPC, $_W;
     $weid = intval($_W['weid']);
     //录入bigwheel_fans数据
     if (empty($weid)) {
         message('抱歉,参数错误!', '', 'error');
     }
     $reply = pdo_fetch("SELECT * FROM " . tablename($this->tablename) . " WHERE weid = :weid ORDER BY `id` DESC", array(':weid' => $weid));
     if ($reply == false) {
         $reply = array('status' => 1, 'isshow' => 1);
     }
     $messagecount = pdo_fetchcolumn("SELECT count(id) FROM " . tablename('message_list') . " WHERE  isshow=1 and weid=" . $weid);
     $p = isset($_GET['p']) ? $_GET['p'] : 1;
     $pagenum = 10;
     $totalpage = floor($messagecount / $pagenum) + 1;
     $prow = ($p - 1) * $pagenum;
     $messagelist = pdo_fetchall("SELECT * FROM " . tablename('message_list') . " WHERE  weid=" . $weid . " and fid=0 and isshow=1  order by create_time desc  limit {$prow},{$pagenum}");
     foreach ($messagelist as $k => $v) {
         $messagelist[$k]['reply'] = pdo_fetchall("SELECT * FROM " . tablename('message_list') . " WHERE  weid=" . $weid . " and fid=" . $v['id'] . " and isshow=1  limit 20");
     }
     //获取fans表中的username
     $nickname = pdo_fetchcolumn("Select nickname from " . tablename('fans') . " where weid=" . $weid . "  and  from_user='" . $_W['fans']['from_user'] . "' limit 1");
     include $this->template('list');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:25,代码来源:site.php


示例13: selectAllOrderBy

 public function selectAllOrderBy($where = '', $order_by = '')
 {
     global $_W;
     $uniacid = $_W['uniacid'];
     $data_list = pdo_fetchall("SELECT " . $this->columns . " FROM " . tablename($this->table_name) . " WHERE 1=1 AND uniacid={$uniacid} {$where} ORDER BY {$order_by}id ASC");
     return $data_list;
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:7,代码来源:FlashCommonService.php


示例14: doMobileIndex

 public function doMobileIndex()
 {
     global $_GPC, $_W;
     $sql = "select * from" . tablename($this->manage) . "where weid='{$_W['weid']}'";
     $list = pdo_fetchall($sql);
     include $this->template('index');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:7,代码来源:site.php


示例15: all_list

 public function all_list($params = array())
 {
     global $_GPC, $_W;
     extract($params);
     $result = array();
     $pindex = max(1, intval($_GPC['page']));
     $psize = $psize ? $psize : '20';
     $where = "WHERE `uniacid` = :uniacid AND ischeck=:ischeck";
     $paras = array();
     $paras[':uniacid'] = $_W['uniacid'];
     $paras[':ischeck'] = intval($ischeck);
     $sql = "SELECT * FROM " . tablename('qiyue_canvas') . $where . ' ORDER BY createtime DESC, id DESC';
     $result['list'] = pdo_fetchall($sql . " LIMIT " . ($pindex - 1) * $psize . ',' . $psize, $paras);
     $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('qiyue_canvas') . $where, $paras);
     if ($_W['isajax']) {
         $context['ajaxcallback'] = 1;
         $result['pager'] = pagination($total, $pindex, $psize, '', $context);
     } else {
         $result['pager'] = pagination($total, $pindex, $psize);
     }
     if (!empty($result['list'])) {
         foreach ($result['list'] as &$row) {
             $row['url'] = url('mobile/module/index', array('name' => 'site', 'id' => $row['id'], 'weid' => $_W['weid']));
         }
     }
     return $result;
 }
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:27,代码来源:site.php


示例16: travel_article_search

function travel_article_search($cid, $type = '', $psize = 20, $orderby = 'id DESC')
{
    global $_GPC, $_W;
    $pindex = max(1, intval($_GPC['page']));
    $result = array();
    $condition = " WHERE weid = '{$_W['weid']}' AND ";
    if (!empty($cid)) {
        $category = pdo_fetch("SELECT parentid FROM " . tablename('article_category') . " WHERE id = '{$cid}'");
        if (!empty($category['parentid'])) {
            $condition .= "ccate = '{$cid}'";
        } else {
            $condition .= "pcate = '{$cid}'";
        }
    }
    if (!empty($cid) && !empty($type)) {
        $condition .= " OR ";
    }
    if (!empty($type)) {
        $type = explode(',', $type);
        foreach ($type as $item) {
            $condition .= "type LIKE '%{$item},%'";
        }
    }
    $sql = "SELECT * FROM " . tablename('travel') . $condition . ' ORDER BY ' . $orderby;
    $result['list'] = pdo_fetchall($sql . " LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
    $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('travel') . $condition);
    $result['pager'] = pagination($total, $pindex, $psize);
    return $result;
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:29,代码来源:model.php


示例17: doWebShare

 public function doWebShare()
 {
     global $_W, $_GPC;
     $operation = !empty($_GPC['op']) ? $_GPC['op'] : 'display-log';
     if ($operation == 'post') {
         $goodsid = $_GPC['goodsid'];
         $item = pdo_fetch("SELECT * FROM " . tablename($this->table_event) . " WHERE goodsid=:goodsid", array(":goodsid" => $goodsid));
         $goods = pdo_fetch("SELECT * FROM " . tablename($this->table_goods) . " WHERE id=:goodsid", array(":goodsid" => $goodsid));
         if (checksubmit()) {
             $share_title = $_GPC['share_title'];
             $share_content = $_GPC['share_content'];
             $discount = $_GPC['discount'];
             $discount_limit = $_GPC['discount_limit'];
             if (false == $item) {
                 pdo_insert($this->table_event, array('weid' => $_W['weid'], 'share_title' => $share_title, 'share_content' => $share_content, 'goodsid' => $goodsid, 'discount' => $discount, 'discount_limit' => $discount_limit));
             } else {
                 pdo_update($this->table_event, array('weid' => $_W['weid'], 'share_title' => $share_title, 'share_content' => $share_content, 'discount' => $discount, 'discount_limit' => $discount_limit), array('goodsid' => $goodsid));
             }
             message("更新成功", $this->createWebUrl("Share", array("op" => "display-event")), "success");
         }
     }
     if ($operation == 'display-event') {
         $list = pdo_fetchall("SELECT * FROM " . tablename($this->table_goods) . " WHERE weid=:weid AND istime=1", array(":weid" => $_W['weid']));
     }
     if ($operation == 'display-log') {
         $list = pdo_fetchall("SELECT COUNT(goodsid) as click, goodsid, orderid, title  FROM " . tablename($this->table_iptable) . " WHERE weid=:weid GROUP BY orderid", array(":weid" => $_W['weid']));
     }
     include $this->template('share');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:29,代码来源:site.php


示例18: respond

	public function respond() {
		global $_W;
		$rid = $this->rule;
		$sql = "SELECT id FROM " . tablename('news_reply') . " WHERE `rid`=:rid AND parentid = 0 ORDER BY RAND()";
		$main = pdo_fetch($sql, array(':rid' => $rid));
		if (empty($main['id'])) {
			return array();
		}
		$sql = "SELECT * FROM " . tablename('news_reply') . " WHERE id = :id OR parentid = :parentid ORDER BY parentid ASC, id ASC LIMIT 8";
		$commends = pdo_fetchall($sql, array(':id'=>$main['id'], ':parentid'=>$main['id']));
		$news = array();
		foreach($commends as $c) {
			$row = array();
			$row['title'] = $c['title'];
			$row['description'] = $c['description'];
			!empty($c['thumb']) && $row['picurl'] = $_W['attachurl'] . trim($c['thumb'], '/');
			$row['url'] = empty($c['url']) ? $_W['siteroot'] . create_url('index/module', array('do' => 'detail', 'name' => 'news', 'id' => $c['id'])) : $c['url'];
			$news[] = $row;
		}
		$r['FromUserName'] = $this->message['to'];
		$r['ToUserName'] = $this->message['from'];
		$r['MsgType'] = 'news';
		$r['ArticleCount'] = count($news);
		$r['Articles'] = array();
		foreach ($news as $row) {
			$r['Articles'][] = array(
				'Title' => $row['title'],
				'Description' => $row['description'],
				'PicUrl' => $row['picurl'],
				'Url' => $row['url'],
				'TagName' => 'item',
			);
		}
		return $r;
	}
开发者ID:royalwang,项目名称:saivi,代码行数:35,代码来源:processor.php


示例19: fieldsFormDisplay

 public function fieldsFormDisplay($rid = 0)
 {
     //要嵌入规则编辑页的自定义内容,这里 $rid 为对应的规则编号,新增时为 0
     global $_W;
     load()->func('tpl');
     $reply = pdo_fetch("SELECT * FROM " . tablename('eso_runman_reply') . " WHERE rid = :rid", array(':rid' => $rid));
     if (empty($reply)) {
         $reply['starttime'] = time();
         $reply['endtime'] = time() + 2592000;
         $reply['setting'] = array();
     } else {
         $reply['setting'] = string2array($reply['setting']);
     }
     $sql = "SELECT * FROM " . tablename('uni_account');
     $uniaccounts = pdo_fetchall($sql);
     $accounts = array();
     if (!empty($uniaccounts)) {
         foreach ($uniaccounts as $uniaccount) {
             $accountlist = uni_accounts($uniaccount['uniacid']);
             if (!empty($accountlist)) {
                 foreach ($accountlist as $account) {
                     if (!empty($account['key']) && !empty($account['secret']) && in_array($account['level'], array(3, 4))) {
                         $accounts[$account['acid']] = $account['name'];
                     }
                 }
             }
         }
     }
     include $this->template('form');
 }
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:30,代码来源:module.php


示例20: doMobileMy

 public function doMobileMy()
 {
     global $_W, $_GPC;
     checkauth();
     $rid = $_GPC['rid'];
     $from_user = $_W['fans']['from_user'];
     $list = pdo_fetchall("SELECT * FROM " . tablename('weizp_album') . " WHERE rid=:rid AND from_user=:from_user", array('rid' => $rid, 'from_user' => $from_user));
     foreach ($list as $k => $v) {
         foreach ($v as $sk => $sv) {
             if ($sk == 'images') {
                 $tmp = unserialize($sv);
                 $images = array();
                 foreach ($tmp as $ssv) {
                     $images[]['id'] = $ssv;
                     $images[]['file'] = pdo_fetchcolumn("SELECT file FROM " . tablename('weizp_images') . "WHERE id='{$ssv}'");
                 }
                 $sv = $images;
             }
             $v[$sk] = $sv;
         }
         $list[$k] = $v;
     }
     //var_dump($list);
     include $this->template('my');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:25,代码来源:site.php



注:本文中的pdo_fetchall函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP pdo_fetchcolumn函数代码示例发布时间:2022-05-15
下一篇:
PHP pdo_fetch_assoc函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap