[Ajuda] Verificar e criar tabela MySqL
#7

Quote:
Originally Posted by PedroH
Посмотреть сообщение
tente assim:

PHP код:
     new Query[500]; 
    
SqL mysql_connect(SQL_HOSTSQL_USERSQL_PASSSQL_DB); 
    
mysql_log(WARNING ERROR); 
    if(!
mysql_errno(SqL)) 
    { 
         
format(Query500"CREATE TABLE IF NOT EXISTS contas (`id`INT(11) AUTO_INCREMENT PRIMARY KEY, `usuario`varchar(24) NOT NULL, `senha` varchar(20) NOT NULL, `skin` INT(20) NOT NULL, `aAdmin` INT(11) NOT NULL, `Gasolina` INT(11) NOT NULL, `Etanol` INT(11) NOT NULL, `Diesel` INT(11) NOT NULL, `GNV` INT(11) NOT NULL, `Dinheiro` INT(11) NOT NULL, `sBancario` INT(11) NOT NULL, `Profissao` INT(11) NOT NULL, `Cidade` INT(11) NOT NULL, `cX` float  NOT NULL, `cY` float  NOT NULL, `cZ` float NOT NULL)");
         
mysql_query(SqLQueryfalse); 
    } 
se nao consegui tente assim:

PHP код:
        strcat(SqL"CREATE TABLE IF NOT EXISTS `contas`\
       (`id`INT(11) AUTO_INCREMENT PRIMARY KEY,\
        `usuario`varchar(24) NOT NULL,\
        `senha` varchar(20) NOT NULL,\
        `skin` INT(20) NOT NULL,\
        `aAdmin` INT(11) NOT NULL,\
        `Admin` INT(11) NOT NULL,\
        `Gasolina` INT(11) NOT NULL,\
        `Etanol` INT(11) NOT NULL,\
        `Diesel` INT(11) NOT NULL,\
        `GNV` INT(11) NOT NULL,\
        `Dinheiro` INT(11) NOT NULL,\
        `sBancario` INT(11) NOT NULL,\
        `Profissao` INT(11) NOT NULL,\
        `Cidade` INT(11) NOT NULL,\
        `cX` float  NOT NULL,\
        `cY` float  NOT NULL,\
        `cZ` float NOT NULL)"
);
        
mysql_query(SqLQueryfalse); 
OBS: Certifique-se de tirar todos os espaзos depois da \


se nao der tente dessa forma:

PHP код:
new string[512];
strcat(string,"texto aqui, texto aqui, texto aqui, texto aqui, texto aqui, texto aqui, texto aqui, texto aqui, ");
strcat(string,"texto aqui, texto aqui, texto aqui, texto aqui, texto aqui, texto aqui, texto aqui, texto aqui, ");
strcat(string,"texto aqui, texto aqui, texto aqui, texto aqui, texto aqui, texto aqui, texto aqui, texto aqui, ");
mysql_query(string); 
exemplo:
PHP код:
    strcat(query"CREATE TABLE IF NOT EXISTS contas(ID int AUTO_INCREMENT PRIMARY KEY, Nome varchar(24) NOT NULL, Senha int NOT NULL, Registro varchar(60) NOT NULL, Score int(20) DEFAULT 0, Admin int(20) DEFAULT 0, Skin int DEFAULT 230, Clan varchar(25) DEFAULT 'Nenhum', ClanL int DEFAULT 0, Dinheiro int(20) DEFAULT 0, Matou int(10) DEFAULT 0, Morreu int(10) DEFAULT 0, IP varchar(20) DEFAULT '255.255.255.255', Banido int(10) DEFAULT 0, Ban_admin varchar(24) DEFAULT 'Ninguem', ");
    
strcat(query"Ban_motivo varchar(100) DEFAULT 'Nenhum', Ban_time int DEFAULT 0, Fome float DEFAULT 100.0, Sede float DEFAULT 100.0, Vida float DEFAULT 100.0, Colete float DEFAULT 100.0, pX float DEFAULT 0.0, pY float DEFAULT 0.0, pZ float DEFAULT 0.0, pA float DEFAULT 0.0, pInt int DEFAULT 0, pWorld int DEFAULT 0, Arma0 int DEFAULT 0, Arma1 int DEFAULT 0, Arma2 int DEFAULT 0, Arma0A int DEFAULT 0, Arma1A int DEFAULT 0, Arma2A int DEFAULT 0, LDTime int DEFAULT 0, Exp int DEFAULT 1, ");
    
strcat(query"Online int DEFAULT 0, OnlineT int DEFAULT 0)"); 
Resolvido. testei todas as opзхes e funcionou.

Agora gostaria que pude-se a arrumar o problema do meu servidor que so ler apenas um plugin.

https://sampforum.blast.hk/showthread.php?tid=640431
Reply


Messages In This Thread
Verificar e criar tabela MySqL - by Marlon307 - 02.09.2017, 22:01
Re: Verificar e criar tabela MySqL - by PedroH - 02.09.2017, 22:40
Re: Verificar e criar tabela MySqL - by RodrigoMSR - 02.09.2017, 23:19
Re: Verificar e criar tabela MySqL - by Marlon307 - 02.09.2017, 23:31
Re: Verificar e criar tabela MySqL - by PedroH - 03.09.2017, 00:06
Re: Verificar e criar tabela MySqL - by RodrigoMSR - 03.09.2017, 00:22
Re: Verificar e criar tabela MySqL - by Marlon307 - 03.09.2017, 00:56

Forum Jump:


Users browsing this thread: 1 Guest(s)