1. KoPa6JIuK Пользователь

    Регистрация:
    27.02.15
    Сообщения:
    504
    Симпатии:
    34
    Пол:
    Мужской
    Парни кто поможет переделать запрос на корректный?


    Код (Unknown Language):
    1. "CREATE TABLE `wc3_player` ( `player_id` int(8) unsigned NOT NULL auto_increment, `player_steamid` varchar(25) NOT NULL default '', `player_ip` varchar(20) NOT NULL default '', `player_name` varchar(35) NOT NULL default '', `time` timestamp(14) NOT NULL, PRIMARY KEY  (`player_id`), KEY `player_name` (`player_name`), KEY `player_ip` (`player_ip`), KEY `player_steamid` (`player_steamid`) ) TYPE=MyISAM;",
    2.     "CREATE TABLE IF NOT EXISTS `wc3_player_extra` ( `player_id` INT( 8 ) UNSIGNED NOT NULL , `player_steamid` VARCHAR( 25 ) NOT NULL , `player_ip` VARCHAR( 20 ) NOT NULL , `player_name` VARCHAR( 35 ) NOT NULL , PRIMARY KEY ( `player_id` )) TYPE=MyISAM ;",
    3.     "CREATE TABLE IF NOT EXISTS `wc3_player_race` ( `player_id` int(8) unsigned NOT NULL default '0', `race_id` tinyint(4) unsigned NOT NULL default '0', `race_xp` int(8) default NULL, PRIMARY KEY  (`player_id`,`race_id`) ) TYPE=MyISAM;",
    4.     "CREATE TABLE IF NOT EXISTS `wc3_player_skill` ( `player_id` int(8) unsigned NOT NULL default '0', `skill_id` tinyint(4) unsigned NOT NULL default '0', `skill_level` tinyint(4) unsigned NOT NULL default '0', PRIMARY KEY  (`player_id`,`skill_id`) ) TYPE=MyISAM;",
    5.     "CREATE TABLE IF NOT EXISTS `wc3_web_race` ( `race_id` tinyint(4) unsigned NOT NULL default '0', `race_lang` char(2) NOT NULL default '', `race_name` varchar(100) default NULL, `race_description` text NOT NULL, PRIMARY KEY  (`race_id`,`race_lang`) ) TYPE=MyISAM;",
    6.     "CREATE TABLE IF NOT EXISTS `wc3_web_skill` ( `skill_id` tinyint(4) unsigned NOT NULL default '0', `skill_lang` char(2) NOT NULL default '', `skill_name` varchar(100) default NULL, `skill_description` text NOT NULL, `skill_type` tinyint(4) unsigned NOT NULL default '0', `skill_owner` tinyint(4) unsigned NOT NULL default '0', PRIMARY KEY  (`skill_id`,`skill_lang`) ) TYPE=MyISAM;",
    7.     "CREATE TABLE IF NOT EXISTS `wc3_config` ( `config_id` varchar(50) NOT NULL, `config_value` varchar(255) NOT NULL, PRIMARY KEY  (`config_id`) ) TYPE=MyISAM;",
    8.     //ū talisman
    9.     "CREATE TABLE IF NOT EXISTS `wc3_player_talisman` ( `player_id` int(8) unsigned NOT NULL default '0', `talisman_id` tinyint(4) unsigned NOT NULL default '0', PRIMARY KEY  (`player_id`,`talisman_id`) ) TYPE=MyISAM;",
    10.     "CREATE TABLE IF NOT EXISTS `wc3_num_talisman` ( `player_id` int(8) unsigned NOT NULL default '0', `talisman_num` tinyint(4) unsigned NOT NULL default '0', PRIMARY KEY  (`player_id`,`talisman_num`) ) TYPE=MyISAM;"
     
  2. neygomon Его Темнейшество :j Команда форума

    Регистрация:
    26.02.15
    Сообщения:
    7.584
    Симпатии:
    4.154
    Пол:
    Мужской
    а че некорректно то?
    дай ошибку
     
  3. KoPa6JIuK Пользователь

    Регистрация:
    27.02.15
    Сообщения:
    504
    Симпатии:
    34
    Пол:
    Мужской
    @neygomon, это я вытащил из файла db_mysqlx.inl а мне надо как то сделать запрос в БД на создания данных таблиц
     
  4. neygomon Его Темнейшество :j Команда форума

    Регистрация:
    26.02.15
    Сообщения:
    7.584
    Симпатии:
    4.154
    Пол:
    Мужской
    @KoPa6JIuK,
    PHP:
    1. CREATE TABLE `wc3_player` ( `player_id` int(8) unsigned NOT NULL auto_increment, `player_steamid` varchar(25) NOT NULL default '', `player_ip` varchar(20) NOT NULL default '', `player_name` varchar(35) NOT NULL default '', `time` timestamp(14) NOT NULL, PRIMARY KEY  (`player_id`), KEY `player_name` (`player_name`), KEY `player_ip` (`player_ip`), KEY `player_steamid` (`player_steamid`) ) TYPE=MyISAM;
    2. CREATE TABLE IF NOT EXISTS `wc3_player_extra` ( `player_id` INT( 8 ) UNSIGNED NOT NULL , `player_steamid` VARCHAR( 25 ) NOT NULL , `player_ip` VARCHAR( 20 ) NOT NULL , `player_name` VARCHAR( 35 ) NOT NULL , PRIMARY KEY ( `player_id` )) TYPE=MyISAM ;
    3. CREATE TABLE IF NOT EXISTS `wc3_player_race` ( `player_id` int(8) unsigned NOT NULL default '0', `race_id` tinyint(4) unsigned NOT NULL default '0', `race_xp` int(8) default NULL, PRIMARY KEY  (`player_id`,`race_id`) ) TYPE=MyISAM;
    4. CREATE TABLE IF NOT EXISTS `wc3_player_skill` ( `player_id` int(8) unsigned NOT NULL default '0', `skill_id` tinyint(4) unsigned NOT NULL default '0', `skill_level` tinyint(4) unsigned NOT NULL default '0', PRIMARY KEY  (`player_id`,`skill_id`) ) TYPE=MyISAM;
    5. CREATE TABLE IF NOT EXISTS `wc3_web_race` ( `race_id` tinyint(4) unsigned NOT NULL default '0', `race_lang` char(2) NOT NULL default '', `race_name` varchar(100) default NULL, `race_description` text NOT NULL, PRIMARY KEY  (`race_id`,`race_lang`) ) TYPE=MyISAM;
    6. CREATE TABLE IF NOT EXISTS `wc3_web_skill` ( `skill_id` tinyint(4) unsigned NOT NULL default '0', `skill_lang` char(2) NOT NULL default '', `skill_name` varchar(100) default NULL, `skill_description` text NOT NULL, `skill_type` tinyint(4) unsigned NOT NULL default '0', `skill_owner` tinyint(4) unsigned NOT NULL default '0', PRIMARY KEY  (`skill_id`,`skill_lang`) ) TYPE=MyISAM;
    7. CREATE TABLE IF NOT EXISTS `wc3_config` ( `config_id` varchar(50) NOT NULL, `config_value` varchar(255) NOT NULL, PRIMARY KEY  (`config_id`) ) TYPE=MyISAM;
    8. CREATE TABLE IF NOT EXISTS `wc3_player_talisman` ( `player_id` int(8) unsigned NOT NULL default '0', `talisman_id` tinyint(4) unsigned NOT NULL default '0', PRIMARY KEY  (`player_id`,`talisman_id`) ) TYPE=MyISAM;
    9. CREATE TABLE IF NOT EXISTS `wc3_num_talisman` ( `player_id` int(8) unsigned NOT NULL default '0', `talisman_num` tinyint(4) unsigned NOT NULL default '0', PRIMARY KEY  (`player_id`,`talisman_num`) ) TYPE=MyISAM;
     
  5. KoPa6JIuK Пользователь

    Регистрация:
    27.02.15
    Сообщения:
    504
    Симпатии:
    34
    Пол:
    Мужской
    @neygomon, ошибка


    Код (Unknown Language):
    1. SQL-запрос:
    2.  
    3. CREATE TABLE  `wc3_player` (
    4.  
    5. `player_id` INT( 8 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
    6. `player_steamid` VARCHAR( 25 ) NOT NULL DEFAULT  '',
    7. `player_ip` VARCHAR( 20 ) NOT NULL DEFAULT  '',
    8. `player_name` VARCHAR( 35 ) NOT NULL DEFAULT  '',
    9. `time` TIMESTAMP( 14 ) NOT NULL ,
    10. PRIMARY KEY (  `player_id` ) ,
    11. KEY  `player_name` (  `player_name` ) ,
    12. KEY  `player_ip` (  `player_ip` ) ,
    13. KEY  `player_steamid` (  `player_steamid` )
    14. ) TYPE = MYISAM ;
    15.  
    16. Ответ MySQL: Документация
    17.  
    18. #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(14) NOT NULL, PRIMARY KEY  (`player_id`), KEY `player_name` (`player_name`), KE' at line 1