When phpcms V9 is installed, if the database name contains uppercase letters, an error is returned when you post the second comment:
MySQL query: Create Table 'jq _ comment_data_1 '('id' int (10) unsigned not null auto_increment, 'commentid' char (30) not null default '', 'siteid' smallint (5) not null default '0', 'userid' int (10) unsigned default '0', 'username' varchar (20) default null, 'creat _ at' int (10) default 0, 'IP' varchar (15) default null, 'status' tinyint (1) default '0', 'content' text, 'direction' tinyint (1) default '0', 'support' Mediumint (8) unsigned default '0', 'reply' tinyint (1) not null default '0', primary key ('id '), key 'commentid' ('commentid'), key 'direction' ('direction'), key 'siteid' ('siteid'), key 'support' ('support ')) engine = MyISAM default charset = utf8; MySQL error: Table 'jq _ comment_data_1 'already existsmysql errno: 1050 message: Table 'jq _ comment_data_1' already existsneed help?
Because this table already existsProgramIf the returned result does not exist, let's take a look.Code:
/* ** Check whether the table exists * @ Param $ table name * @ return Boolean */ Public Function Table_exists ( $ Table ){ $ Tables = $ This -> List_tables (); Return In_array ($ Table , $ Tables )? 1: 0 ;} Public Function List_tables (){ $ Tables = Array (); $ This -> Execute ("show tables" ); While ( $ R = $ This ->Fetch_next ()){ $ Tables [] = $ R ['Tables _ in _'. $ This -> Config ['database' ];} Return $ Tables ;}
The field returned by executing show tables is "tables_in_whaleclub", the database name configured in my database is whaleclub, and the actual database name is whaleclub.
Solution: Do not use uppercase letters during installation. modify the configuration to lowercase letters to solve the problem.