SQL zapis
DarkGL
03.01.2010
Korzystam z kodu pluginu Chat Logger SQL
no i jest w nim coś takiego
no i jest w nim coś takiego
format(query_create,1000,"CREATE TABLE IF NOT EXISTS `%s`(`id` int(11) NOT NULL auto_increment,`name` varchar(100) NOT NULL default '',`authid` varchar(100) NOT NULL default '',`ip` varchar(100) NOT NULL default '',`alive` int(11) NOT NULL default '0', `team` varchar(100) NOT NULL default '',`date` date NOT NULL default '0000-00-00',`time` time NOT NULL default '00:00:00',`cmd` varchar(100) NOT NULL default '',`message` text NOT NULL,PRIMARY KEY (`id`));",table)domyślam że tworzy on tabele ale za bardzo nie wiem jak ją zmodyfikować jak dodać własne pole
Vertricus
03.01.2010
A jakie pole np. chciałbyś dodać?
Ja np. zawsze szukam w googlach http://www.sppi.pl/w...enie-mysql2.pdf powinno ci jako tako pomóc punkt 4.
Ja np. zawsze szukam w googlach http://www.sppi.pl/w...enie-mysql2.pdf powinno ci jako tako pomóc punkt 4.
R3X
04.01.2010
zapytanie zapisane w takiej postaci łatwiej obczajać:
CREATE TABLE IF NOT EXISTS `%s`(
`id` int(11) NOT NULL auto_increment,
`name` varchar(100) NOT NULL default '',
`authid` varchar(100) NOT NULL default '',
`ip` varchar(100) NOT NULL default '',
`alive` int(11) NOT NULL default '0',
`team` varchar(100) NOT NULL default '',
`date` date NOT NULL default '0000-00-00',
`time` time NOT NULL default '00:00:00',
`cmd` varchar(100) NOT NULL default '',
`message` text NOT NULL,
PRIMARY KEY (`id`)
);
DarkGL
04.01.2010
Vertricus świetna lektura dzięki
no i klops zrobiłem coś takiego
no i klops zrobiłem coś takiego
new query_create[2048]; format(query_create,2047,"CREATE TABLE IF NOT EXISTS `%s`(`id` int(11) NOT NULL auto_increment,`name` varchar(100) NOT NULL default '',`authid` varchar(100) NOT NULL default '',`Player_<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_Wojownik` int,`Player_Level_Wojownik` int,`Player_hp_Wojownik` int,`Player_int_Wojownik` int,`Player_str_Wojownik` int,`Player_dex_Wojownik` int,`Player_point_Wojownik` int,`Player_<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_ninja` int,`Player_Level_ninja` int,`Player_hp_ninja` int,`Player_int_ninja` int,`Player_str_ninja` int,`Player_dex_ninja` int,`Player_point_ninja` int,`Player_<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_sura` int,`Player_Level_sura` int,`Player_hp_sura` int,`Player_int_sura` int,`Player_str_sura` int,`Player_dex_sura` int,`Player_point_sura` int,`Player_<img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/tongue2.gif' class='bbc_emoticon' alt='xP' />_szaman` int,`Player_Level_szaman` int,`Player_hp_szaman` int,`Player_int_szaman` int,`Player_str_szaman` int,`Player_dex_szaman` int,Player_point_szaman` int,PRIMARY KEY (`id`)",table); SQL_ThreadQuery(g_SqlX,"QueryHandle",query_create)a podczas kompilacji dostaję błędy w tych trzech linijkach
Welcome to the AMX Mod X 1.76-300 Compiler. Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team Error: Input line too long (after substitutions) on line 417 Error: Invalid string (possibly non-terminated string) on line 418 Warning: Loose indentation on line 419 Error: Undefined symbol "int_ninja" on line 419 Error: Undefined symbol "int" on line 419 Error: Invalid expression, assumed zero on line 419 Error: Too many error messages on one line on line 419 Compilation aborted. 6 Errors. Could not locate output file C:\Documents and Settings\Home\Desktop\compiler\compiler\compiled\Metin2mod_1.4b.amx (compile failed).