SA-MP Forums Archive
MYSQL PROBLEM - 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 PROBLEM (/showthread.php?tid=612748)



MYSQL PROBLEM - kexy96 - 21.07.2016

Код:
CMD:ujfrakcio(playerid, params[])
{
	new string[80], f_name[30], f_type, count;

	if(sscanf(params, "s[30]i", f_name, f_type))
	    return SendClientMessage(playerid, -1, "/ujfrakcio [nйv] [tнpus]");

	format(string, sizeof(string), "Frakciу elkйszнtve! SQLID:%d FrakciуNйv: %s Tнpusa: %d!", count, f_name, f_type);
	SendClientMessage(playerid, -1, string);

	new query[2000];

	mysql_format(mysql, query, sizeof(query), "INSERT INTO factions (fName, fType) VALUES ('%e', %i)", query, f_name, f_type);

	mysql_tquery(mysql, query);

   	fData[count][fID] 	= 	count;

   	fData[count][fName] 	= 	f_name;
   	fData[count][fType] = 	f_type;


	count ++;

	return 1;
}
What's the problem??
I create faction and sql table: fName: empty and fType: random number...(103,97,71,0)
HELP PLS! THANKS!


Re: MYSQL PROBLEM - Konstantinos - 21.07.2016

Код:
mysql_format(mysql, query, sizeof(query), "INSERT INTO factions (fName, fType) VALUES ('%e', %i)", query, f_name, f_type);
Remove the red text. It takes empty string as name and the name as type because of that.


Re: MYSQL PROBLEM - kexy96 - 21.07.2016

THANK YOU!!! +REP