SA-MP Forums Archive
Mysql problems - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Mysql problems (/showthread.php?tid=586545)



Mysql problems - Ekspresasltu - 22.08.2015

Hello need help i got error mysql and cant fix it

Код:
CMySQLHandler::Query(INSERT INTO `ServerPlayers` (`User`, `Password`, `IP`) VALUES ('', '7746DF345F54547871B4F2A6E2299A34224C53ECA63BA5CCAE06B1A8457F1) - An error has occured. (Error ID: 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 ''7746DF345F54547871B4F2A6E2299A34224C53ECA63BA5CCAE06B1A8457F1' at line 1)
Error line full

Код:
		
case RegisterDialog:
{
	if(!response) return Kick(playerid);
	if(strlen(inputtext) > 0)
	{
		new salt[11];
		for(new i; i < 10; i++)
		{
			salt[i] = random(79) + 47;
		}
		salt[10] = 0;
		SHA256_PassHash(inputtext, salt, AccountInfo[playerid][pPassword], 65);
		new String[200], Query[130];
		format(Query, sizeof(Query), "INSERT INTO `ServerPlayers` (`User`, `Password`, `Salt`) VALUES ('%s', '%s', '%s')", AccountInfo[playerid][pName], AccountInfo[playerid][pPassword], salt);
		mysql_query(Query);
		AccountInfo[playerid][Newbie]   = 1; // Nustatom, kad naujokas.
		AccountInfo[playerid][LoggedIn] = 1; // Nustatom, kad dar nepadarė 'Spawn'!
		HowMuchRegisteredPlayers ++; // Kiek iљ viso uћregistruotų ћaidėjų serverį.
		format(String, sizeof(String), "{F2F2F2}Vardas: {01df74}%s{F2F2F2} įregistruotas į duomėnų bazę.\nPradėti ћaisti galite paspaudę {01df74}'Spawn' {F2F2F2}arba {01df74}'Shift'{F2F2F2} mygtukus.\n", PlayerName(playerid));
		ShowPlayerDialog(playerid, AccountCreatedDialog, DIALOG_STYLE_MSGBOX, "{F2F2F2}Sąskaita uћregistruota!", String, "Uћdaryti", "");
	}
	else
	{
		StartPlayerLogin(playerid);
	}
}



Re: Mysql problems - Inn0cent - 22.08.2015

Increase the query length, try 365.


Re: Mysql problems - Ekspresasltu - 22.08.2015

Quote:
Originally Posted by Inn0cent
Посмотреть сообщение
Increase the query length, try 365.
Thanks +rep