Will it's have error
#1

i try to save player date when player disconnect from server:

Код:
mysql_format(g_SQL, query, sizeof query, " UPDATE `players` SET `x` = %f, `y` = %f, `z` = %f, `angle` = %f, `interior` = %d, `vw` = %d WHERE `id` = %d LIMIT 1" ,Player[playerid][X_Pos], Player[playerid][Y_Pos], Player[playerid][Z_Pos], Player[playerid][A_Pos], GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid), Player[playerid][ID]);
	mysql_format(g_SQL, query, sizeof query, " Update `players` SET `ip`= %s, `lastlogin` = %s, `level` = %d, `money` = %d, `bankmoney` = %d, `adminlevel` = %d WHERE `id` = %d LIMIT 1", GetIp(playerid), GetDate(), Player[playerid][Level], Player[playerid][Money], Player[playerid][BankMoney], Player[playerid][AdminLevel], Player[playerid][ID);
	mysql_tquery(g_SQL, query);
will it have error ? if i do it don't right show me the best way
Reply
#2

or can i use like this ??

Код:
format(query, sizeof(query), " UPDATE `players` SET `x` = %f, `y` = %f, `z` = %f, `angle` = %f, `interior` = %d, `vw` = %d, `ip`= %s, `lastlogin` = %s, `level` = %d, `money` = %d, `bankmoney` = %d, `adminlevel` = %d",
		Player[playerid][X_Pos], 
		Player[playerid][Y_Pos], 
		Player[playerid][Z_Pos], 
		Player[playerid][A_Pos], 
		GetPlayerInterior(playerid), 
		GetPlayerVirtualWorld(playerid),
		GetIp(playerid), 
		GetDate(), 
		Player[playerid][Level], 
		Player[playerid][Money], 
		Player[playerid][BankMoney], 
		Player[playerid][AdminLevel]
		);
	mysql_tquery(g_SQL, query);
Reply
#3

Why don't you try it and find out?
Reply
#4

Why you don't do every UPDATE inside one query? Also if you want to spread it in multiple queries, you need to do it like this:
Код:
mysql_format();
mysql_tquery();
mysql_format();
mysql_tquery();
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)