table_common_advertisement_custom.php 841 B

1234567891011121314151617181920212223242526272829303132333435363738
  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_common_advertisement_custom.php 27449 2012-02-01 05:32:35Z zhangguosheng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_common_advertisement_custom extends discuz_table
  12. {
  13. public function __construct() {
  14. $this->_table = 'common_advertisement_custom';
  15. $this->_pk = 'id';
  16. parent::__construct();
  17. }
  18. public function fetch_all_data() {
  19. return DB::fetch_all("SELECT * FROM %t ORDER BY id", array($this->_table));
  20. }
  21. public function fetch_by_name($name) {
  22. return DB::fetch_first("SELECT * FROM %t WHERE name=%s", array($this->_table, $name));
  23. }
  24. public function get_id_by_name($name) {
  25. $result = $this->fetch_by_name($name);
  26. return $result['id'];
  27. }
  28. }
  29. ?>