当前位置: 首页>>代码示例>>PHP>>正文


PHP XDB::fetch_first方法代码示例

本文整理汇总了PHP中XDB::fetch_first方法的典型用法代码示例。如果您正苦于以下问题:PHP XDB::fetch_first方法的具体用法?PHP XDB::fetch_first怎么用?PHP XDB::fetch_first使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XDB的用法示例。


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

示例1: fetch_by_id_idtype

 public function fetch_by_id_idtype($id, $idtype, $uid = 0)
 {
     if ($uid) {
         $uidsql = ' AND ' . XDB::field('uid', $uid);
     }
     return XDB::fetch_first("SELECT * FROM %t WHERE id=%d AND idtype=%s {$uidsql}", array($this->_table, $id, $idtype));
 }
开发者ID:herosrx,项目名称:shops,代码行数:7,代码来源:table_home_favorite.php

示例2: fetch_userinfo

 public function fetch_userinfo($uid, $fid)
 {
     if (empty($uid) || empty($fid)) {
         return array();
     }
     return XDB::fetch_first("SELECT * FROM %t WHERE fid=%d AND uid=%d", array($this->_table, $fid, $uid));
 }
开发者ID:herosrx,项目名称:shops,代码行数:7,代码来源:table_forum_groupuser.php

示例3: fetch_by_username

 public function fetch_by_username($username)
 {
     $user = array();
     if ($username) {
         $user = XDB::fetch_first('SELECT * FROM %t WHERE username=%s', array($this->_table, $username));
     }
     return $user;
 }
开发者ID:herosrx,项目名称:shops,代码行数:8,代码来源:table_xcommon_member.php

示例4: check_moderator_for_uid

 public function check_moderator_for_uid($fid, $uid, $accessmasks = 0)
 {
     if (!intval($fid) || !intval($uid)) {
         return false;
     }
     if ($accessmasks) {
         $accessadd1 = ', a.allowview, a.allowpost, a.allowreply, a.allowgetattach, a.allowgetimage, a.allowpostattach';
         $accessadd2 = "LEFT JOIN " . XDB::table('forum_access') . " a ON a." . XDB::field('uid', $uid) . " AND a." . XDB::field('fid', $fid);
     }
     return XDB::fetch_first("SELECT ff.postperm, m.uid AS istargetmod {$accessadd1}\n\t\t\t\tFROM " . XDB::table($this->_table) . " ff\n\t\t\t\t{$accessadd2}\n\t\t\t\tLEFT JOIN " . XDB::table('forum_moderator') . " m ON m.fid=%d AND m.uid=%d\n\t\t\t\tWHERE ff.fid=%d", array($fid, $uid, $fid));
 }
开发者ID:herosrx,项目名称:shops,代码行数:11,代码来源:table_forum_forumfield.php

示例5: fetch

 public function fetch($id, $force_from_db = false)
 {
     $data = array();
     if (!empty($id)) {
         if ($force_from_db || ($data = $this->fetch_cache($id)) === false) {
             $data = XDB::fetch_first('SELECT * FROM ' . XDB::table($this->_table) . ' WHERE ' . XDB::field($this->_pk, $id));
             if (!empty($data)) {
                 $this->store_cache($id, $data);
             }
         }
     }
     return $data;
 }
开发者ID:herosrx,项目名称:shops,代码行数:13,代码来源:discuz_table.php

示例6: fetch_by_bid

 public function fetch_by_bid($bid)
 {
     return XDB::fetch_first("SELECT * FROM %t WHERE bid='%i'", array($this->_table, $bid));
 }
开发者ID:herosrx,项目名称:shops,代码行数:4,代码来源:table_sanree_brand_businesses_module.php

示例7: get_by_cateidanduid

 public function get_by_cateidanduid($uid, $cateid)
 {
     return XDB::fetch_first("SELECT * FROM %t where uid=%d,cateid=%d", array($this->_table, $uid, $cateid));
 }
开发者ID:herosrx,项目名称:shops,代码行数:4,代码来源:table_sanree_brand_category.php

示例8: get_by_id

 public function get_by_id($helpid)
 {
     return XDB::fetch_first("SELECT * FROM %t WHERE flid=%d", array($this->_table, $helpid));
 }
开发者ID:herosrx,项目名称:shops,代码行数:4,代码来源:table_sanree_brand_friendly_link.php

示例9: get_by_diystyleid

 public function get_by_diystyleid($diystyleid)
 {
     return XDB::fetch_first("SELECT * FROM %t WHERE diystyleid=%d", array($this->_table, $diystyleid));
 }
开发者ID:herosrx,项目名称:shops,代码行数:4,代码来源:table_sanree_brand_diystyle.php

示例10: fetch_by_credits

 public function fetch_by_credits($credits = 0)
 {
     return XDB::fetch_first("SELECT * FROM %t WHERE creditshigher<=%d AND %d<creditslower LIMIT 1", array($this->_table, $credits, $credits));
 }
开发者ID:herosrx,项目名称:shops,代码行数:4,代码来源:table_forum_grouplevel.php

示例11: show_table_by_tableid

 public function show_table_by_tableid($tableid)
 {
     return XDB::fetch_first('SHOW CREATE TABLE %t', array(self::get_tablename($tableid)));
 }
开发者ID:herosrx,项目名称:shops,代码行数:4,代码来源:table_forum_post.php

示例12: fetch_max_image

 public function fetch_max_image($tableid, $idtype, $id)
 {
     return $this->_check_id($idtype, $id) ? XDB::fetch_first('SELECT * FROM %t WHERE %i AND isimage IN (1, -1) ORDER BY width DESC LIMIT 1', array($this->_get_table($tableid), XDB::field($idtype, $id))) : array();
 }
开发者ID:herosrx,项目名称:shops,代码行数:4,代码来源:table_forum_attachment_n.php

示例13: fetch_mfandtag_by_groupid

 public function fetch_mfandtag_by_groupid($groupid)
 {
     return XDB::fetch_first("SELECT ismf,istag FROM %t WHERE groupid=%d", array($this->_table, $groupid));
 }
开发者ID:herosrx,项目名称:shops,代码行数:4,代码来源:table_sanree_brand_group.php

示例14: fetch_all

 public function fetch_all()
 {
     return XDB::fetch_first("SELECT * FROM %t ", array($this->_table));
 }
开发者ID:herosrx,项目名称:shops,代码行数:4,代码来源:table_sanree_brand_menu_order.php

示例15: get_forum_by_fid

 function get_forum_by_fid($fid, $field = '', $table = 'forum')
 {
     static $forumlist = array('forum' => array(), 'forumfield' => array());
     $table = $table != 'forum' ? 'forumfield' : 'forum';
     $return = array();
     if (!array_key_exists($fid, $forumlist[$table])) {
         $forumlist[$table][$fid] = XDB::fetch_first("SELECT * FROM " . XDB::table('forum_' . $table) . " WHERE fid=%d", array($fid));
         if (!is_array($forumlist[$table][$fid])) {
             $forumlist[$table][$fid] = array();
         }
     }
     if (!empty($field)) {
         $return = isset($forumlist[$table][$fid][$field]) ? $forumlist[$table][$fid][$field] : null;
     } else {
         $return = $forumlist[$table][$fid];
     }
     return $return;
 }
开发者ID:herosrx,项目名称:shops,代码行数:18,代码来源:table_forum_forum.php


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