MYSQL PROBLEM
#1

Код:
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!
Reply
#2

Код:
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.
Reply
#3

THANK YOU!!! +REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)