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


PHP db::rows方法代码示例

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


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

示例1: get

 function get($res, $name = 'clouds')
 {
     $nums_clouds = array();
     if (db::rows() > 0) {
         while ($row = mysql_fetch_array($res)) {
             $nums_clouds[$row['tag_name']] = $row['num'];
         }
         ksort($nums_clouds);
         $max_size = 200;
         // max font size in %
         $min_size = 100;
         // min font size in %
         $max_qty = max(array_values($nums_clouds));
         $min_qty = min(array_values($nums_clouds));
         $spread = $max_qty - $min_qty;
         if (0 == $spread) {
             $spread = 1;
         }
         $step = ($max_size - $min_size) / $spread;
         foreach ($nums_clouds as $k => $v) {
             $size = $min_size + ($v - $min_qty) * $step;
             s::roll($name, array('name' => $k, 'size' => $size, 'value' => $v));
         }
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:25,代码来源:clouds.php

示例2: rows

 public function rows()
 {
     $escape = !empty($this->query['escape']);
     $query = $this->__build_a_query();
     $this->query = array();
     return db::rows(self::Q_GET_BY_ATTR, $query, $escape);
 }
开发者ID:viking2000,项目名称:web-antarix,代码行数:7,代码来源:model.php

示例3: checkDuplicate

 function checkDuplicate()
 {
     db::table('mails');
     if (params::get('mail_id')) {
         db::where('mail_id', params::get('mail_id'), '!=');
     }
     db::where('mail_name', params::get('value'));
     db::select('mail_id');
     if (db::rows() != 0) {
         buffer::set('error');
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:12,代码来源:main.module.php

示例4: checkDuplicate

 function checkDuplicate()
 {
     db::table('admin_users');
     if (params::get('user_id') !== false) {
         db::where('user_id', params::get('user_id'), '!=');
     }
     db::where('user_login', params::get('user_login'));
     db::select();
     if (db::rows() != 0) {
         buffer::set('error');
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:12,代码来源:users.module.php

示例5: show

 function show()
 {
     $dir = IMAGES_PATH . 'index/';
     db::table('images');
     db::where('img_set', '1');
     db::orderByRand();
     $img = db::assoc();
     if (db::rows() != 0) {
         $file = $dir . $img['img_id'] . '.jpg';
         buffer::set('<img src="' . $file . '" width="700" height="360" alt="" />');
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:12,代码来源:main.handler.php

示例6: download

 function download()
 {
     $file_id = params::get('file');
     db::table('files');
     db::where('file_id', $file_id);
     $file = db::assoc();
     if (db::rows() == 0) {
         web::error404();
     }
     $file_link = FILES_ROOT . 'all/' . $file_id . '.' . $file['file_type'];
     files::downloadFile($file_link);
 }
开发者ID:rigidus,项目名称:ea,代码行数:12,代码来源:main.handler.php

示例7: show

 function show()
 {
     $event = web::getEvent();
     if ($event === false) {
         $year = date('Y');
     } else {
         $year = $event;
     }
     s::set('info_date_select', htmlspecialchars($year));
     $sql = "SELECT `section_year` as date FROM `info_sections` WHERE `section_view`='0'  GROUP BY `date` ORDER BY `date` DESC";
     $res = db::query($sql);
     $rows = mysql_num_rows($res);
     if ($rows > 1) {
         s::add('info_date_selector', '<ul class="years">');
         while ($row = mysql_fetch_assoc($res)) {
             if ($row['date'] == $year) {
                 $row['date'] = '<li><span>' . $row['date'] . '</span></li>';
             } else {
                 $row['date'] = '<li><a href="' . web::get('page_folder') . '' . $row['date'] . '/">' . $row['date'] . '</a></li>';
             }
             s::add('info_date_selector', $row['date']);
         }
         s::add('info_date_selector', '</ul>');
     }
     $files = array();
     db::table('info_files');
     $r = db::select();
     while ($a = mysql_fetch_assoc($r)) {
         $files[$a['section_id']][] = $a;
     }
     db::table('info_sections');
     db::order('section_order', 'DESC');
     db::where('section_year', $year);
     $r = db::select();
     if (db::rows() == 0) {
         web::error404();
     }
     while ($a = mysql_fetch_assoc($r)) {
         if ($a['section_view'] == '0') {
             s::roll('sections', $a);
         } else {
             s::roll('sections_view', $a);
         }
         if (isset($files[$a['section_id']])) {
             foreach ($files[$a['section_id']] as $v) {
                 $v['file_icon'] = files::getFileIco($v['file_type']);
                 $v['file_size'] = files::parseSizeSmart($v['file_size']);
                 s::roll('items' . $a['section_id'], $v);
             }
         }
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:52,代码来源:main.handler.php

示例8: showOne

 function showOne()
 {
     $news_id = web::getThis();
     db::table('news');
     db::where('news_pub', '1');
     $news = db::assoc();
     if (db::rows() == 0) {
         web::error404();
     }
     $news['news_date'] = dt::date2print('%d %F %Y', $news['news_date']);
     s::set('page_title', $news['news_title']);
     s::set('page_header', $news['news_title']);
     s::set($news);
 }
开发者ID:rigidus,项目名称:ea,代码行数:14,代码来源:main.handler.php

示例9: getTmpls

 function getTmpls($site_id = 1)
 {
     db::table('templates');
     db::where('site_id', $site_id);
     db::where('tmpl_pub', '1');
     db::order('tmpl_name');
     $res = db::select();
     if (db::rows() == 0) {
         s::section('no_data');
     } else {
         s::section('yes_data');
     }
     while ($row = mysql_fetch_assoc($res)) {
         s::roll('tmpls', $row);
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:16,代码来源:templates.app.php

示例10: loadPage

 function loadPage($page_id = false, $page_folder = false)
 {
     db::table('pages');
     db::join('templates', 'pages', 'tmpl_id');
     if ($page_id) {
         db::where('page_id', $page_id);
     }
     if ($page_folder) {
         db::where('page_folder', $page_folder);
     }
     db::where('site_id', SITE_ID, '=', 'pages');
     db::limit(1);
     $res = db::select();
     if (db::rows() == 1) {
         $row = mysql_fetch_assoc($res);
         $row = web::pageSettings($row);
         web::$page = $row;
         s::set($row);
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:20,代码来源:main.handler.php

示例11: load

 function load($user_id)
 {
     if (self::$user) {
         return true;
     }
     db::table('admin_users');
     db::where('user_id', $user_id);
     db::where('user_pub', 1);
     db::limit(1);
     self::$user = db::assoc();
     if (db::rows() == 0) {
         admin::logout();
     }
     define("ADMIN_USER_ID", $user_id);
     define("ADMIN_USER_SITE_ID", self::get('site_id'));
     define("ADMIN_USER_GROUP_ID", self::get('group_id'));
     s::set('ADMIN_USER_LOGIN', self::get('user_login'));
     s::set('ADMIN_USER_ID', $user_id);
     return true;
 }
开发者ID:rigidus,项目名称:ea,代码行数:20,代码来源:adminUser.php

示例12: dump

 function dump()
 {
     $tables = implode(', ', self::$tables);
     $conf = implode(', ', self::$conf);
     db::table('admin_log_trash');
     db::order('log_id', 'DESC');
     db::limit(31, 100);
     $res = db::select('log_id');
     if (db::rows() > 0) {
         while ($row = mysql_fetch_assoc($res)) {
             self::delete($row['log_id']);
         }
     }
     if (self::$files) {
         $log_tmpl = 1;
     } else {
         $log_tmpl = 0;
     }
     db::table('admin_log_trash');
     db::insert('', 'NOW()', '', $tables, $conf, '', $log_tmpl, ADMIN_USER_ID);
     $log_id = mysql_insert_id();
     dump::tables(self::$tables);
     dump::backup(SYS_ROOT . 'var/trash/' . $log_id . '_base.zip');
     if (self::$conf) {
         foreach (self::$conf as $v) {
             zipfile::add(SYS_ROOT . 'conf/web/' . $v . '.ini');
         }
         zipfile::create(SYS_ROOT . 'var/trash/' . $log_id . '_conf.zip');
     }
     if (self::$files) {
         foreach (self::$files as $v) {
             zipfile::add($v);
         }
         zipfile::create(SYS_ROOT . 'var/trash/' . $log_id . '_files.zip');
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:36,代码来源:trash.php

示例13: join

 public static function join($fields = array('*'), $join = array(), $where = array(), $single = false, $sort = array(), $order = "DESC", $offset = 0, $limit = 0)
 {
     if ($single) {
         return parent::row(self::join_str($fields, $join, $where, $sort, $order, $offset, $limit));
     } else {
         return parent::rows(self::join_str($fields, $join, $where, $sort, $order, $offset, $limit));
     }
 }
开发者ID:rajuthapa8086,项目名称:SimpleMVC,代码行数:8,代码来源:active_record.php

示例14: saveVersion

 function saveVersion($tmpl_id, $code)
 {
     db::table('templates_versions');
     db::where('tmpl_id', $tmpl_id);
     db::where('version_code', $code);
     db::order('version_date', 'DESC');
     db::limit(1);
     db::select();
     if (db::rows() == 0) {
         /*
         	delete over 20
         */
         db::table('templates_versions');
         db::where('tmpl_id', $tmpl_id);
         db::order('version_date', 'DESC');
         db::limit(20, 100);
         db::delete();
         db::table('templates_versions');
         db::insert('', 'NOW()', $code, '', '', $tmpl_id, ADMIN_USER_ID, ADMIN_SITE_ID);
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:21,代码来源:main.module.php

示例15: add

 function add()
 {
     events::observe('add', 'menus', '_save');
     events::observer();
     admin::components('tabs', 'validator');
     appPages::getPagesSelect(ADMIN_SITE_ID);
     appMenus::getMenus(ADMIN_SITE_ID);
     // test reserved
     db::table('admin_reserved');
     db::where('`table`', 'menus');
     db::where('user_id', ADMIN_USER_ID);
     $menu_id = db::get('id');
     if (db::rows() == 0) {
         db::table('menus');
         db::smartInsert(array('menu_pub' => '2', 'site_id' => ADMIN_SITE_ID));
         $menu_id = mysql_insert_id();
         db::table('admin_reserved');
         db::insert('', 'menus', $menu_id, ADMIN_USER_ID);
     }
     f::set('menu_id', $menu_id);
 }
开发者ID:rigidus,项目名称:ea,代码行数:21,代码来源:main.module.php


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