[Ajuda] mysql_tquery nгo funciona
#1

Quote:

if(strlen(inputtext) < 4 || strlen(inputtext) > 20){
new str[148]; format(str,sizeof(str),"{FF0000}[ERRO]: {FFFFFF}Vocк deve digitar uma senha entre: {FF0000}4 {FFFFFF}e {FF0000}20 {FFFFFF}caracteres.",-1);
SendClientMessage(playerid,-1,str);
new dialog[240];
format(dialog,sizeof(dialog),"{27E834}Conta: {FFFFFF}%s\n{27E834}Status: {FFFFFF}Sem registros\nDigite uma {27E834}senha para cadastrar-se.",PlayerInfo[playerid][pNome]);
ShowPlayerDialog(playerid,DIALOG_REGISTRO,DIALOG_S TYLE_INPUT,"Registrando",dialog,"{27E834}Registrar ","{FF0000}Sair");
}else{
new query[100];
new MyHash[64 + 1];
SHA256_PassHash(inputtext, "78sdjs86d2h", MyHash, sizeof MyHash);
mysql_format(conexao, query, sizeof(query), "INSERT INTO players (Nick,Senha) VALUES ('%s','%s)", PlayerInfo[playerid][pNome], MyHash);
mysql_tquery(conexao, query, "DadosRegistrados", "i", playerid);
RegistrarDados(playerid);
}
}
Fui fazer este sistema de registro/login, e acabei encontrando um problema, quando uso o mysql_tquery, ele nгo funciona, nгo envia os dados e nem chama a funзгo.
Reply
#2

Tente assim. se nгo der certo diga a versгo do mysql que vocк estб usando.

PHP код:
format(querysizeof(query), "INSERT INTO players (Nick,Senha) VALUES ('%s','%s')"PlayerInfo[playerid][pNome], MyHash);
mysql_tquery(MySQL:conexaoquery"DadosRegistrados""ii"0playerid); 
Reply
#3

Nгo funcionou, eu estou utilizando a versгo R41-4 (acho que й a mais atualizada).
Reply
#4

PHP код:
mysql_format(conexaoquerysizeof(query), "INSERT INTO players (Nick,Senha) VALUES ('%s','%s')"PlayerInfo[playerid][pNome], MyHash); 
mysql_tquery(conexaoquery"DadosRegistrados""ii"0playerid); 
Vocк esqueceu de fechar as aspas simples do ъltimo valor.


@edit

Quote:
Originally Posted by Diego54
Посмотреть сообщение
Mesmo assim nгo foi, nгo sei mais o que fazer.
Entгo poste os logs do mysql.
Reply
#5

Mesmo assim nгo foi, nгo sei mais o que fazer.
Reply
#6

Quote:
Originally Posted by Diego54
Посмотреть сообщение
Mesmo assim nгo foi, nгo sei mais o que fazer.
talvez possa ser essa criptografia na senha, tente sem ela e veja se funciona.
Reply
#7

Tirei e tambйm nгo consegui.
Reply
#8

Quote:
Originally Posted by SammyJ
Посмотреть сообщение
PHP код:
mysql_format(conexaoquerysizeof(query), "INSERT INTO players (Nick,Senha) VALUES ('%s','%s')"PlayerInfo[playerid][pNome], MyHash); 
mysql_tquery(conexaoquery"DadosRegistrados""ii"0playerid); 
Vocк esqueceu de fechar as aspas simples do ъltimo valor.


@edit



Entгo poste os logs do mysql.
Quote:

[15:57:16] [ERROR] mysql_connect: handle error: no database specified
[15:57:16] [ERROR] mysql_errno: invalid connection handle '1'
[15:57:16] [ERROR] mysql_close: invalid connection handle '0'
[18:10:15] [WARNING] mysql_connect: no password specified
[20:07:19] [WARNING] mysql_connect: no password specified
[20:07:53] [ERROR] error #1064 while executing query "UPDATE players Admin = 0, Skin = 0, Dinheiro = 0 WHERE Nick = 'Diego'": 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 '= 0, Skin = 0, Dinheiro = 0 WHERE Nick = 'Diego'' at line 1
[20:08:34] [ERROR] error #1064 while executing query "UPDATE players Admin = 0, Skin = 0, Dinheiro = 0 WHERE Nick = 'Diego'": 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 '= 0, Skin = 0, Dinheiro = 0 WHERE Nick = 'Diego'' at line 1
[20:08:53] [ERROR] mysql_format: destination size '100' is too small
[20:08:53] [ERROR] error #1065 while executing query "": Query was empty
[20:09:13] [ERROR] error #1064 while executing query "UPDATE players Admin = 0, Skin = 3, Dinheiro = 500 WHERE Nick = 'Diego'": 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 '= 0, Skin = 3, Dinheiro = 500 WHERE Nick = 'Diego'' at line 1
[20:10:50] [WARNING] mysql_connect: no password specified
[20:11:33] [ERROR] mysql_format: destination size '100' is too small
[20:11:33] [ERROR] error #1065 while executing query "": Query was empty
[20:11:43] [ERROR] error #1064 while executing query "UPDATE players Admin = 0, Skin = 3, Dinheiro = 500 WHERE Nick = 'Diego'": 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 '= 0, Skin = 3, Dinheiro = 500 WHERE Nick = 'Diego'' at line 1
[20:19:44] [WARNING] mysql_connect: no password specified
[20:19:59] [ERROR] mysql_format: destination size '100' is too small
[20:19:59] [ERROR] error #1065 while executing query "": Query was empty
[20:20:11] [ERROR] error #1064 while executing query "UPDATE players Admin = 0, Skin = 3, Dinheiro = 500 WHERE Nick = 'Diego'": 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 '= 0, Skin = 3, Dinheiro = 500 WHERE Nick = 'Diego'' at line 1
[20:23:07] [WARNING] mysql_connect: no password specified
[20:23:16] [ERROR] mysql_format: destination size '100' is too small
[20:23:16] [ERROR] error #1065 while executing query "": Query was empty
[20:23:34] [ERROR] error #1064 while executing query "UPDATE players Admin = 0, Skin = 3, Dinheiro = 500 WHERE Nick = 'Diego'": 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 '= 0, Skin = 3, Dinheiro = 500 WHERE Nick = 'Diego'' at line 1
[21:38:04] [WARNING] mysql_connect: no password specified
[21:38:37] [ERROR] mysql_format: destination size '1' is too small
[21:38:37] [ERROR] error #1065 while executing query "": Query was empty
[21:38:57] [ERROR] error #1064 while executing query "UPDATE players Admin = 0, Skin = 3, Dinheiro = 500 WHERE Nick = 'Diego'": 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 '= 0, Skin = 3, Dinheiro = 500 WHERE Nick = 'Diego'' at line 1
[21:42:56] [WARNING] mysql_connect: no password specified
[21:43:06] [ERROR] error #1065 while executing query "": Query was empty
[21:43:19] [ERROR] error #1064 while executing query "UPDATE players Admin = 0, Skin = 3, Dinheiro = 500 WHERE Nick = 'Diego'": 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 '= 0, Skin = 3, Dinheiro = 500 WHERE Nick = 'Diego'' at line 1
[08:26:45] [WARNING] mysql_connect: no password specified
[08:27:11] [ERROR] mysql_format: destination size '100' is too small
[08:27:11] [ERROR] error #1065 while executing query "": Query was empty
[08:27:16] [ERROR] error #1064 while executing query "UPDATE players Admin = 0, Skin = 3, Dinheiro = 500 WHERE Nick = 'Diego'": 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 '= 0, Skin = 3, Dinheiro = 500 WHERE Nick = 'Diego'' at line 1
[11:22:34] [WARNING] mysql_connect: no password specified
[11:22:49] [ERROR] mysql_format: destination size '100' is too small
[11:22:49] [ERROR] error #1065 while executing query "": Query was empty
[11:22:59] [ERROR] error #1064 while executing query "UPDATE players Admin = 0, Skin = 3, Dinheiro = 500 WHERE Nick = 'Diego'": 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 '= 0, Skin = 3, Dinheiro = 500 WHERE Nick = 'Diego'' at line 1
[13:01:49] [WARNING] mysql_connect: no password specified
[13:02:11] [ERROR] error #1364 while executing query "INSERT INTO players (Nick,Senha) VALUES ('Diego','foda1234')": Field 'Skin' doesn't have a default value
[13:02:15] [ERROR] error #1064 while executing query "UPDATE players Admin = 0, Skin = 3, Dinheiro = 500 WHERE Nick = 'Diego'": 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 '= 0, Skin = 3, Dinheiro = 500 WHERE Nick = 'Diego'' at line 1
Este й o log
Reply
#9

Parece que vocк tem que especificar um valor para Skin.

(Estou no celular, entгo nгo dб para ajudar a mais que isso).
Reply
#10

Na query que cria a tabela, defina um valor padrгo para todas as colunas usando DEFAULT.

Exemplo:
PHP код:
Skin int DEFAULT 26Matou int DEFAULT 0Morreu int DEFAULT 0IP varchar(16) DEFAULT '255.255.255.255' 
OBS: vocк deve recriar a tabela depois disso.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)