table_forum_post_tableid.php 851 B

12345678910111213141516171819202122232425262728293031323334353637
  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_forum_post_tableid.php 28127 2012-02-23 02:31:37Z zhangguosheng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_forum_post_tableid extends discuz_table
  12. {
  13. public function __construct() {
  14. $this->_table = 'forum_post_tableid';
  15. $this->_pk = 'pid';
  16. parent::__construct();
  17. }
  18. public function alter_auto_increment($auto_increment) {
  19. return DB::query("ALTER TABLE %t AUTO_INCREMENT=%d", array($this->_table, $auto_increment));
  20. }
  21. public function delete_by_lesspid($pid) {
  22. return DB::query("DELETE FROM %t WHERE pid<%d", array($this->_table, $pid));
  23. }
  24. public function fetch_max_id() {
  25. return DB::result_first('SELECT MAX(pid) FROM '.DB::table($this->_table));
  26. }
  27. }
  28. ?>