當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。