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


PHP XDB::result_first方法代码示例

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


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

示例1: count_by_wherec

 public function count_by_wherec($condition)
 {
     if (is_array($condition)) {
         $where = " AND " . implode($condition, ' AND ');
     }
     return XDB::result_first("SELECT COUNT(*) FROM %t WHERE 1 %i", array($this->_table, $where));
 }
开发者ID:herosrx,项目名称:shops,代码行数:7,代码来源:table_sanree_brand_msg.php

示例2: count_by_fid

 public function count_by_fid($fids)
 {
     if (empty($fids)) {
         return 0;
     }
     return XDB::result_first('SELECT COUNT(*) FROM %t WHERE ' . XDB::field('fid', $fids), array($this->_table));
 }
开发者ID:herosrx,项目名称:shops,代码行数:7,代码来源:table_forum_forum_threadtable.php

示例3: fetch_groupnum_by_founderuid

 public function fetch_groupnum_by_founderuid($uid)
 {
     if (empty($uid)) {
         return false;
     }
     return XDB::result_first("SELECT COUNT(*) FROM " . XDB::table($this->_table) . " WHERE founderuid=%d", array($uid));
 }
开发者ID:herosrx,项目名称:shops,代码行数:7,代码来源:table_forum_forumfield.php

示例4: fetch_all_username_by_uid

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

示例5: fetch_count

 public function fetch_count()
 {
     return XDB::result_first("SELECT count(*) FROM " . XDB::table('forum_grouplevel'));
 }
开发者ID:herosrx,项目名称:shops,代码行数:4,代码来源:table_forum_grouplevel.php

示例6: check_variable

 public function check_variable($pluginid, $variable)
 {
     return XDB::result_first("SELECT COUNT(*) FROM %t WHERE pluginid=%d AND variable=%s", array($this->_table, $pluginid, $variable));
 }
开发者ID:herosrx,项目名称:shops,代码行数:4,代码来源:table_common_pluginvar.php

示例7: result_level_by_id

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

示例8: fetch_groupname_by_order

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

示例9: fetch_all_for_grouplist

 public function fetch_all_for_grouplist($orderby = 'displayorder', $fieldarray = array(), $num = 1, $fids = array(), $sort = 0, $getcount = 0)
 {
     if ($fieldarray && is_array($fieldarray)) {
         $fieldadd = '';
         foreach ($fieldarray as $field) {
             $fieldadd .= $field . ', ';
         }
     } else {
         $fieldadd = 'ff.*, ';
     }
     $start = 0;
     if (is_array($num)) {
         list($start, $snum) = $num;
     } else {
         $snum = $num;
     }
     $orderbyarray = array('displayorder' => 'f.displayorder DESC', 'dateline' => 'ff.dateline DESC', 'lastupdate' => 'ff.lastupdate DESC', 'membernum' => 'ff.membernum DESC', 'thread' => 'f.threads DESC', 'activity' => 'f.commoncredits DESC');
     $useindex = $orderby == 'displayorder' ? 'USE INDEX(fup_type)' : '';
     $orderby = !empty($orderby) && $orderbyarray[$orderby] ? "ORDER BY " . $orderbyarray[$orderby] : '';
     $limitsql = $num ? "LIMIT {$start}, {$snum} " : '';
     $field = $sort ? 'fup' : 'fid';
     $fids = $fids && is_array($fids) ? 'f.' . $field . ' IN (' . dimplode($fids) . ')' : '';
     if (empty($fids)) {
         $levelsql = " AND f.level>'-1'";
     }
     $fieldsql = $fieldadd . ' f.fid, f.name, f.threads, f.posts, f.todayposts, f.level as flevel ';
     if ($getcount) {
         return XDB::result_first("SELECT count(*) FROM " . XDB::table($this->_table) . " f {$useindex} WHERE" . ($fids ? " {$fids} AND " : '') . " f.type='sub' AND f.status=3 {$levelsql}");
     }
     return XDB::fetch_all("SELECT {$fieldsql} FROM " . XDB::table($this->_table) . " f {$useindex} LEFT JOIN " . XDB::table("forum_forumfield") . " ff ON ff.fid=f.fid WHERE" . ($fids ? " {$fids} AND " : '') . " f.type='sub' AND f.status=3 {$levelsql} {$orderby} {$limitsql}");
 }
开发者ID:herosrx,项目名称:shops,代码行数:31,代码来源:table_forum_forum.php

示例10: get_total_filesize

 public function get_total_filesize()
 {
     $attachsize = 0;
     for ($i = 0; $i < 10; $i++) {
         $attachsize += XDB::result_first("SELECT SUM(filesize) FROM " . XDB::table('forum_attachment_' . $i));
     }
     return $attachsize;
 }
开发者ID:herosrx,项目名称:shops,代码行数:8,代码来源:table_forum_attachment_n.php

示例11: fetch_by_modename

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

示例12: count_by_id_idtype

 public function count_by_id_idtype($id, $idtype)
 {
     return XDB::result_first("SELECT COUNT(*) FROM %t WHERE id=%d AND idtype=%s", array($this->_table, $id, $idtype));
 }
开发者ID:herosrx,项目名称:shops,代码行数:4,代码来源:table_home_favorite.php

示例13: getid_by_keyword

 public function getid_by_keyword($keyword)
 {
     return XDB::result_first("SELECT id FROM %t WHERE keyword=%s", array($this->_table, $keyword));
 }
开发者ID:herosrx,项目名称:shops,代码行数:4,代码来源:table_sanree_brand_searchword.php

示例14: fetch_max_tid

 public function fetch_max_tid()
 {
     return XDB::result_first("SELECT MAX(tid) as maxtid FROM " . XDB::table('forum_thread'));
 }
开发者ID:herosrx,项目名称:shops,代码行数:4,代码来源:table_forum_thread.php

示例15: count_by_tid_post

 public function count_by_tid_post($tableid, $tid)
 {
     return XDB::result_first('SELECT COUNT(*) FROM %t WHERE tid=%d AND invisible=0 AND first=0', array(self::get_tablename($tableid), $tid));
 }
开发者ID:herosrx,项目名称:shops,代码行数:4,代码来源:table_forum_post.php


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