13.07.2015, 13:38
Hello guys I just created a MySQL system and I am facing some problems, here is my msql's log
Register dialog
When I check my database there is nothing created
Код:
[16:36:50] [DEBUG] mysql_format - connection: 1, len: 128, format: "SELECT `Password` FROM `playerdata` WHERE `Username` = '%e' LIMIT 1"
[16:36:50] [DEBUG] mysql_tquery - connection: 1, query: "SELECT `Password` FROM `playerdata` WHERE `Username` = 'SecretBo", callback: "OnAccountCheck", format: "i"
[16:36:50] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - starting query execution
[16:36:50] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - query was successfully executed within 0.338 milliseconds
[16:36:50] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[16:36:50] [DEBUG] Calling callback "OnAccountCheck"..
[16:36:50] [DEBUG] cache_get_data - connection: 1
[16:36:50] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[16:36:52] [DEBUG] mysql_format - connection: 1, len: 300, format: "INSERT INTO `playerdata` (`Username`, `Password`, `IP`, `Admin`, `Helper`, `VIP` ,`Money`, `Kills`, `Deaths`) VALUES ('%e', '%s'..."
[16:36:52] [ERROR] mysql_format - destination size is too small
[16:36:52] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO `playerdata` (`Username`, `Password`, `IP`, `Admin`,", callback: "OnAccountRegister", format: "i"
[16:36:52] [DEBUG] CMySQLQuery::Execute[OnAccountRegister] - starting query execution
[16:36:52] [ERROR] CMySQLQuery::Execute[OnAccountRegister] - (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 '' at line 1
[16:36:52] [DEBUG] CMySQLQuery::Execute[OnAccountRegister] - error will be triggered in OnQueryError
Код:
public:OnAccountCheck(playerid)
{
new rows, fields;
cache_get_data(rows, fields, mysql);
if(rows)
{
cache_get_field_content(0, "PASS", PlayerData[playerid][pPass], mysql, 129);
printf("%s", PlayerData[playerid][pPass]);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Login - "yellow"sbAdmin",""white"Welcome back on "red""SERVER_NAME""white", insert your password bellow\n"white"to login on your account",""yellow"Login","Quit");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"Register - "yellow"sbAdmin",""white"Welcome on "red""SERVER_NAME""white", insert your password bellow\n"white"to register an account",""yellow"Register","Quit");
}
return 1;
}


