Otóż mam pytanie jak zrobić drugą tabelę do bazy sql w diablomod.
Próbowałem czegoś takiego:
public sql_start() { if(g_boolsqlOK) return; new host[128], user[64], pass[64], database[64]; get_cvar_string("diablo_sql_database", database, 63); get_cvar_string("diablo_sql_host", host, 127); get_cvar_string("diablo_sql_user", user, 63); get_cvar_string("diablo_sql_pass", pass, 63); g_SqlTuple = SQL_MakeDbTuple(host, user, pass, database); get_cvar_string("diablo_sql_table", g_sqlTable, 63); new q_command[512]; formatex(q_command, 511, "CREATE TABLE IF NOT EXISTS `%s` (`nick` VARCHAR(48),`ip` VARCHAR(32),`sid` VARCHAR(32),`klasa` INT(2),`lvl` INT(3) DEFAULT 1,`exp` INT(9) DEFAULT 0,`str` INT(3) DEFAULT 0,`int` INT(3) DEFAULT 0,`dex` INT(3) DEFAULT 0,`pak` INT(3) DEFAULT 0,`agi` INT(3) DEFAULT 0,`kas` INT(3) DEFAULT 0,`dam` INT(3) DEFAULT 0,`men` INT(3) DEFAULT 0,`mis` INT(3) DEFAULT 0,`art` INT(3) DEFAULT 0,`wyt` INT(3) DEFAULT 0) DEFAULT CHARSET `utf8` COLLATE `utf8_general_ci`", g_sqlTable); formatex(q_command, 511, "CREATE TABLE IF NOT EXISTS `tabela` (`nick` VARCHAR(48),`ip` VARCHAR(32),`sid` VARCHAR(32),`klasa` INT(2),`lvl` INT(3) DEFAULT 1,`exp` INT(9) DEFAULT 0) DEFAULT CHARSET `utf8` COLLATE `utf8_general_ci`"); SQL_ThreadQuery(g_SqlTuple, "TableHandle", q_command); }i w innych miejscach też po dodawałem i w logach jest błąd, że błąd połączenia z tą 2 tabela, ale nawet jej nie tworzy, a 1 tworzy.
Jak ktoś mógłby pomóc w zrobieniu tej drugiej tabeli lub zrobieniu, żebym w tej 1 mógł umieścić więcej danych.
Użytkownik kijkol edytował ten post 22.05.2013 12:10