📄 10001_mysql_queries.php
字号:
$SQL[] = "update ".SQL_PREFIX."members SET restrict_post=0"; $this->error = array(); $this->sqlcount = 0; $this->ipsclass->DB->return_die = 1; foreach( $SQL as $query ) { $this->ipsclass->DB->query( $query ); if ( $this->ipsclass->DB->error ) { $this->error[] = $query."<br /><br />".$this->ipsclass->DB->error; } else { $this->sqlcount++; } } } /*-------------------------------------------------------------------------*/ // STEP 20: OPTIMIZATION /*-------------------------------------------------------------------------*/ function step_20() { global $DB, $std, $ibforums; $SQL[] = "alter table ".SQL_PREFIX."tracker change topic_id topic_id int(10) NOT NULL default '0';"; $SQL[] = "ALTER TABLE ".SQL_PREFIX."tracker ADD INDEX(topic_id);"; $SQL[] = "ALTER TABLE ".SQL_PREFIX."topics CHANGE pinned pinned TINYINT( 1 ) DEFAULT '0' NOT NULL;"; $SQL[] = "ALTER TABLE ".SQL_PREFIX."topics CHANGE approved approved TINYINT( 1 ) DEFAULT '0' NOT NULL;"; $SQL[] = "ALTER TABLE ".SQL_PREFIX."topics ADD INDEX(topic_firstpost);"; $SQL[] = "alter table ".SQL_PREFIX."calendar_events change eventid eventid mediumint(8) NOT NULL auto_increment;"; $SQL[] = "alter table ".SQL_PREFIX."calendar_events change userid userid mediumint(8) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."contacts change id id mediumint(8) NOT NULL auto_increment;"; $SQL[] = "alter table ".SQL_PREFIX."contacts change contact_id contact_id mediumint(8) NOT NULL;"; $SQL[] = "alter table ".SQL_PREFIX."contacts change member_id member_id mediumint(8) NOT NULL;"; $SQL[] = "alter table ".SQL_PREFIX."faq change id id mediumint(8) NOT NULL auto_increment;"; $SQL[] = "alter table ".SQL_PREFIX."forum_tracker change frid frid mediumint(8) NOT NULL auto_increment;"; $SQL[] = "alter table ".SQL_PREFIX."forum_tracker change forum_id forum_id smallint(5) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."forums change last_poster_id last_poster_id mediumint(8) NOT NULL DEFAULT '0';"; $SQL[] = "alter table ".SQL_PREFIX."languages change lid lid mediumint(8) NOT NULL auto_increment;"; $SQL[] = "alter table ".SQL_PREFIX."member_extra change id id mediumint(8) NOT NULL;"; $SQL[] = "alter table ".SQL_PREFIX."members change id id mediumint(8) NOT NULL;"; $SQL[] = "alter table ".SQL_PREFIX."members change mgroup mgroup smallint(3) NOT NULL;"; $SQL[] = "alter table ".SQL_PREFIX."moderator_logs change id id int(10) NOT NULL auto_increment;"; $SQL[] = "alter table ".SQL_PREFIX."moderator_logs change topic_id topic_id int(10) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."moderator_logs change post_id post_id int(10);"; $SQL[] = "alter table ".SQL_PREFIX."moderator_logs change member_id member_id mediumint(8) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."moderator_logs change ip_address ip_address VARCHAR(16) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."moderators change mid mid mediumint(8) NOT NULL auto_increment;"; $SQL[] = "alter table ".SQL_PREFIX."moderators change member_id member_id mediumint(8) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."pfields_content change member_id member_id mediumint(8) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."polls change pid pid mediumint(8) NOT NULL auto_increment;"; $SQL[] = "alter table ".SQL_PREFIX."polls change tid tid int(10) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."polls change starter_id starter_id mediumint(8) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."polls change votes votes smallint(5) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."polls change forum_id forum_id smallint(5) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."posts change pid pid int(10) NOT NULL default '0' auto_increment;"; $SQL[] = "alter table ".SQL_PREFIX."posts change author_id author_id mediumint(8) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."posts change topic_id topic_id int(10) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."posts change ip_address ip_address varchar(16) NOT NULL DEFAULT '';"; $SQL[] = "alter table ".SQL_PREFIX."posts change use_sig use_sig tinyint(1) NOT NULL DEFAULT '0';"; $SQL[] = "alter table ".SQL_PREFIX."posts change use_emo use_emo tinyint(1) NOT NULL DEFAULT '0';"; $SQL[] = "alter table ".SQL_PREFIX."sessions change member_id member_id mediumint(8) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."sessions change in_forum in_forum smallint(5) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."stats change TOTAL_REPLIES TOTAL_REPLIES int(10) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."stats change TOTAL_TOPICS TOTAL_TOPICS int(10) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."stats change LAST_MEM_ID LAST_MEM_ID mediumint(8) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."stats change MEM_COUNT MEM_COUNT mediumint(8) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."topics change tid tid int(10) NOT NULL default '0' auto_increment;"; $SQL[] = "alter table ".SQL_PREFIX."topics change starter_id starter_id mediumint(8) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."topics change last_poster_id last_poster_id mediumint(8) NOT NULL DEFAULT '0';"; $SQL[] = "alter table ".SQL_PREFIX."tracker change trid trid mediumint(8) NOT NULL auto_increment;"; $SQL[] = "alter table ".SQL_PREFIX."tracker change member_id member_id mediumint(8) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."voters change vid vid int(10) NOT NULL default '0' auto_increment;"; $SQL[] = "alter table ".SQL_PREFIX."voters change tid tid int(10) NOT NULL default '0';"; $SQL[] = "alter table ".SQL_PREFIX."voters change forum_id forum_id smallint(5) NOT NULL default '0';"; $SQL[] = "UPDATE ".SQL_PREFIX."members SET language=''"; $this->error = array(); $this->sqlcount = 0; $this->ipsclass->DB->return_die = 1; foreach( $SQL as $query ) { $this->ipsclass->DB->query( $query ); if ( $this->ipsclass->DB->error ) { $this->error[] = $query."<br /><br />".$this->ipsclass->DB->error; } else { $this->sqlcount++; } } } /*-------------------------------------------------------------------------*/ // STEP 19: DROPPING TABLES /*-------------------------------------------------------------------------*/ function step_19() { global $DB, $std, $ibforums; $SQL[] = "DROP TABLE ".SQL_PREFIX."tmpl_names;"; $SQL[] = "DROP TABLE ".SQL_PREFIX."forums_bak;"; $SQL[] = "DROP TABLE ".SQL_PREFIX."categories;"; $SQL[] = "DROP TABLE ".SQL_PREFIX."messages;"; $this->error = array(); $this->sqlcount = 0; $this->ipsclass->DB->return_die = 1; foreach( $SQL as $query ) { $this->ipsclass->DB->query( $query ); if ( $this->ipsclass->DB->error ) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -