19.04.2015, 18:39
Estou fazendo registro em mysql normal tudo certo seguindo um tutorial em inglкs
mais quando o player conecta na Hora da funзгo
no log mysql aperece error nгo salva nada.
mais quando o player conecta na Hora da funзгo
pawn Код:
mysql_tquery(mysql, query, "OnAccountCheck", "i", playerid);
PHP код:
[15:37:00] [DEBUG] mysql_errno - connection: 1
[15:37:22] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT `Senha`, `ID`, FROM `players` WHERE `Nome` = '%e' = LIMIT 1"
[15:37:22] [DEBUG] mysql_tquery - connection: 1, query: "SELECT `Senha`, `ID`, FROM `players` WHERE `Nome` = 'RayFilho' =", callback: "OnAccountCheck", format: "i"
[15:37:22] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[15:37:22] [DEBUG] mysql_tquery - scheduling query "SELECT `Senha`, `ID`, FROM `players` WHERE `Nome` = 'RayFilho' = LIMIT 1"..
[15:37:22] [DEBUG] CMySQLQuery::Execute[OnAccountCheck(i)] - starting query execution
[15:37:22] [ERROR] CMySQLQuery::Execute[OnAccountCheck(i)] - (error #1064) 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 'FROM `players` WHERE `Nome` = 'RayFilho' = LIMIT 1' at line 1
[15:37:22] [DEBUG] CMySQLQuery::Execute[OnAccountCheck(i)] - error will be triggered in OnQueryError
[15:37:22] [DEBUG] CMySQLQuery::Execute[OnAccountCheck(i)] - data being passed to ProcessCallbacks()
[15:37:22] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
[15:37:25] [DEBUG] mysql_format - connection: 1, len: 128, format: "UPDATE `players` SET `pAdmin`=%d,`Vip`=%d,`Dinheiro`=%d,`PosX`=%f, `PosY`=%f, `PosZ`=%f WHERE `ID`=%d"
[15:37:25] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `players` SET `pAdmin`=0,`Vip`=0,`Dinheiro`=0,`PosX`=0.00", callback: "(null)", format: "(null)"
[15:37:25] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[15:37:26] [DEBUG] mysql_tquery - scheduling query "UPDATE `players` SET `pAdmin`=0,`Vip`=0,`Dinheiro`=0,`PosX`=0.000000, `PosY`=0.000000, `PosZ`=-10.537059 WHERE `ID`=0"..
[15:37:26] [DEBUG] CMySQLQuery::Execute[()] - starting query execution
[15:37:26] [DEBUG] CMySQLQuery::Execute[()] - query was successful
[15:37:26] [DEBUG] CMySQLQuery::Execute[()] - no callback specified, skipping result saving
[15:37:26] [DEBUG] CMySQLQuery::Execute[()] - data being passed to ProcessCallbacks()
[15:37:26] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
pawn Код:
public OnAccountCheck(playerid)
{
new rows, fields;
cache_get_data(rows, fields, mysql);
if(rows)
{
cache_get_field_content(0, "Senha", PlayerInfo[playerid][Senha], mysql, 129);
PlayerInfo[playerid][ID] = cache_get_field_content_int(0, "ID");
printf("%s", PlayerInfo[playerid][Senha]);
ShowPlayerDialog(playerid, Login, DIALOG_STYLE_INPUT, "LOGIN","Para Jogar Vocк Deve Fazer o Login","LOGAR","SAIR");
}
else
{
ShowPlayerDialog(playerid,Registro,DIALOG_STYLE_INPUT, "REGISTRO","Registre Antes De Jogar","REGISTRAR","SAIR");
}
return 1;
}