本文整理汇总了PHP中DB::fetch_all方法的典型用法代码示例。如果您正苦于以下问题:PHP DB::fetch_all方法的具体用法?PHP DB::fetch_all怎么用?PHP DB::fetch_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DB
的用法示例。
在下文中一共展示了DB::fetch_all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUserStatus
public static function getUserStatus($uids)
{
$uid = implode("','", $uids);
$limit = count($uids);
$userList = DB::fetch_all('SELECT uid,username,status FROM %t WHERE uid in(%n) ORDER BY uid desc LIMIT %d', array('common_member', $uids, $limit), 'uid');
return $userList;
}
示例2: fetch_all
function fetch_all($start, $limit, $where = '', $field = 'dateline', $sort = 'DESC')
{
if ($where) {
$wherestr = "WHERE " . $where;
}
return DB::fetch_all("SELECT * FROM %t {$wherestr} ORDER BY %i {$sort} " . DB::limit($start, $limit), array($this->_table, $field));
}
示例3: fetch_all_by_access
public function fetch_all_by_access($access)
{
if (!is_numeric($access) && !is_array($access)) {
return array();
}
return DB::fetch_all('SELECT * FROM %t WHERE ' . DB::field('access', $access) . ' ORDER BY dateline DESC', array($this->_table));
}
示例4: fetch_all_by_action
public function fetch_all_by_action($action)
{
if (!empty($action)) {
return DB::fetch_all('SELECT * FROM %t WHERE action IN(%n)', array($this->_table, $action), $this->_pk);
}
return array();
}
示例5: draw
function draw()
{
global $display;
$cmd = Url::get('cmd');
if ($cmd == 'update') {
AZMemcache::do_put("prhot_ver:", 0);
Url::redirect_current();
}
$this->beginForm();
$list_cat = array(999999999 => 'Mặc định', 0 => 'Trang chủ');
$list_cat += AZLib::getTopCats();
$item = DB::fetch_all('SELECT item_id,status,product_hot_cat_id,end_time,start_time FROM product_hot');
$items_tmp = array();
foreach ($item as $values) {
if (isset($list_cat[$values['product_hot_cat_id']])) {
$items_tmp[$values['product_hot_cat_id']]['cat_name'] = $list_cat[$values['product_hot_cat_id']];
if ($values['status'] == 1) {
$items_tmp[$values['product_hot_cat_id']]['item_vip'][$values['item_id']]['cat_id'] = $values['product_hot_cat_id'];
$items_tmp[$values['product_hot_cat_id']]['item_vip'][$values['item_id']]['start_time'] = date("d/m/Y", $values['start_time']);
$items_tmp[$values['product_hot_cat_id']]['item_vip'][$values['item_id']]['end_time'] = date("d/m/Y", $values['end_time']);
} else {
$items_tmp[$values['product_hot_cat_id']]['item'][$values['item_id']] = $values['product_hot_cat_id'];
}
}
}
$items = array();
foreach ($list_cat as $key => $values) {
if (isset($items_tmp[$key])) {
$items[$key] = $items_tmp[$key];
}
}
$display->add('items', $items);
$display->output('ManageProductHot');
$this->endForm();
}
示例6: all
public static function all()
{
static $query;
DB::prepare_query($query, "SELECT * FROM `judge_daemon` ORDER BY `judge_host`");
$query->execute();
return DB::fetch_all('JudgeDaemon', $query);
}
示例7: fetch_all_by_fid
public function fetch_all_by_fid($fid, $position = false, $moderatorid = false, $start = 0, $limit = 0)
{
$position = $position ? ' AND ' . DB::field('position', array(0, $position)) : '';
$moderatorid = $moderatorid ? ' AND ' . DB::field('moderatorid', array(0, $moderatorid)) : '';
$limit = $start && $limit ? ' LIMIT ' . intval($start) . ', ' . intval($limit) : '';
return DB::fetch_all('SELECT * FROM %t WHERE fid=%d %i %i ORDER BY displayorder %i', array($this->_table, $fid, $position, $moderatorid, $limit));
}
示例8: get_sitemap_list
public function get_sitemap_list($type, $offset=0, $limit=0)
{
if ($offset >= 0 && $limit > 0) {
return DB::fetch_all('SELECT * FROM %t WHERE type=%d LIMIT %d, %d', array($this->_table, $type, $offset, $limit));
}
return DB::fetch_all('SELECT * FROM %t WHERE type=%d', array($this->_table, $type));
}
示例9: fetch_all_inviteuid
public function fetch_all_inviteuid($fid, $inviteuids, $uid)
{
if (empty($fid) || empty($uid) || empty($inviteuids)) {
return array();
}
return DB::fetch_all("SELECT inviteuid FROM %t WHERE fid=%d AND " . DB::field('inviteuid', $inviteuids) . " AND uid=%d", array($this->_table, $fid, $uid));
}
示例10: fetch_all_by_search
public function fetch_all_by_search($username, $start = 0, $limit = 0, $order = 'dateline', $sort = 'DESC')
{
$ordersql = $order ? " ORDER BY {$order} {$sort} " : '';
$wheresql = 'WHERE 1';
$wheresql .= $username ? ' AND ' . DB::field('username', $username, 'like') : '';
return DB::fetch_all('SELECT * FROM %t %i %i ' . DB::limit($start, $limit), array($this->_table, $wheresql, $ordersql));
}
示例11: fetch_all_by_default
public function fetch_all_by_default()
{
if (($data = $this->fetch_cache('all')) === false) {
$data = DB::fetch_all("SELECT * FROM %t WHERE `default`!='' ORDER BY display DESC", array($this->_table));
}
return $data;
}
示例12: fetch_all_by_id
public function fetch_all_by_id($id)
{
if (!$id) {
return;
}
return DB::fetch_all("SELECT * FROM %t WHERE %i ORDER BY displayorder", array($this->_table, DB::field('medalid', $id)));
}
示例13: fetch_all
public function fetch_all($uids, $variables)
{
if (empty($uids) || empty($variables)) {
return array();
}
return DB::fetch_all('SELECT * FROM %t WHERE ' . DB::field('uid', $uids) . ' AND ' . DB::field('variable', $variables), array($this->_table));
}
示例14: fetch_all_by_uid
public function fetch_all_by_uid($uid)
{
if (!$uid) {
return null;
}
return DB::fetch_all('SELECT * FROM %t WHERE %i', array($this->_table, DB::field('uid', $uid)), $this->_pk);
}
示例15: fetch_all_for_order
public function fetch_all_for_order($typeid = array())
{
if (!empty($typeid)) {
$where = ' WHERE ' . DB::field('typeid', $typeid);
}
return DB::fetch_all("SELECT * FROM " . DB::table('forum_threadtype') . " {$where} ORDER BY displayorder");
}