table_mobile_setting.php 888 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: table_mobile_setting.php 31700 2012-09-24 03:46:59Z zhangjie $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_mobile_setting extends discuz_table {
  12. public function __construct() {
  13. $this->_table = 'mobile_setting';
  14. $this->_pk = 'skey';
  15. parent::__construct();
  16. }
  17. public function fetch($skey) {
  18. return DB::result_first('SELECT svalue FROM %t WHERE skey=%s', array($this->_table, $skey));
  19. }
  20. public function fetch_all($skeyarr) {
  21. if(!empty($skeyarr)) {
  22. return array();
  23. }
  24. $return = array();
  25. $query = DB::query('SELECT * FROM %t WHERE '.DB::field($this->_pk, $skeyarr), array($this->_table));
  26. while($svalue = DB::fetch($query)) {
  27. $return[$svalue['skey']] = $svalue['svalue'];
  28. }
  29. return $return;
  30. }
  31. }