13.06.2018, 23:06
Quote:
Ao usar '%d', vocк estб dizendo que o conteъdo й uma string, mas a database estб configurada para receber um nъmero, entгo ela nгo executa o cуdigo.
Код:
(`Profissao`='%d'/*Errado*/, `Nome`='%s' /*Correto*/ Код:
mysql_format(IDConexao, Query, sizeof(Query), "INSERT INTO `contas`\ (`Profissao`, `Nome`, `Senha`, `Admin`, `Level`, `Exp`, `Skin`, `Vip`, `Dinheiro`, `SaldoBancario`, `SpawnX`, `SpawnY`, `SpawnZ`, `SpawnA`)\ VALUES\ (`Profissao`=%d, `Nome`='%s', `Senha`='%s', `Admin`=%d, `Level`=%d, `Exp`=%d, `Skin`=%d, `Vip`=%d, `Dinheiro`=%d, `SaldoBancario`=%d, `SpawnX`=%f, `SpawnY`=%f, `SpawnZ`=%f, `SpawnA`=%f",0, pNome[playerid], pSenha[playerid],0,0,0,0,0,0,0,0,0,0,0); mysql_tquery(IDConexao, Query); PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0); print("Conta Cadastrada com sucesso!"); CarregarRegistro(playerid); |
PHP код:
mysql_query(IDConexao, "CREATE TABLE IF NOT EXISTS `Contas` (`ID`int AUTO_INCREMENT PRIMARY KEY,`Profissao` varchar(24) NOT NULL DEFAULT 'Desempregado',\
`Nome`varchar(24) NOT NULL,`Senha` varchar(24) NOT NULL,`Admin` tinyint,`Level` int(10),`Exp` tinyint,`Skin` int(3),\
`Vip` int(10),`Dinheiro` int(20),`SaldoBancario` int(20),`SpawnX` float(20),`SpawnY` float(20),`SpawnZ` float(20),`SpawnA` float(20))", false);
Organizei e coloquei assim :
PHP код:
mysql_format(IDConexao, Query, sizeof(Query), "INSERT INTO `contas` (`ID`, `Profissao`, `Nome`, `Senha`, `Admin`, `Level`, `Exp`, `Skin`, `Vip`, `Dinheiro`, `SaldoBancario`, `SpawnX`, `SpawnY`, `SpawnZ`, `SpawnA`) VALUES (NULL, NULL, '%s', '%s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)", pNome[playerid], pSenha[playerid]);