Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Sedo_Chinese_Model_Temp extends XenForo_Model
- {
- public function createTempDb()
- {
- return $this->_getDb()->query("CREATE TABLE IF NOT EXISTS sedo_temp (
- id INT NOT NULL AUTO_INCREMENT,
- name tinytext NOT NULL,
- loops INT NOT NULL,
- temp longtext NOT NULL,
- redirect tinytext NOT NULL,
- phrase tinytext NOT NULL,
- extras mediumtext NOT NULL,
- PRIMARY KEY (id)
- )
- ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci;"
- );
- }
- public function deleteTempDb()
- {
- XenForo_Application::setSimpleCacheData('sedo_chinese_loop', false);
- return $this->_getDb()->query("DROP TABLE IF EXISTS sedo_temp");
- }
- public function getDatasByName($name)
- {
- return $this->_getDb()->fetchRow('
- SELECT *
- FROM sedo_temp
- WHERE name = ?
- ', $name);
- }
- public function getDatasById($id)
- {
- return $this->_getDb()->fetchRow('
- SELECT *
- FROM sedo_temp
- WHERE id = ?
- ', $id);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement