23.06.2012, 09:23
I'm currently using R6 on my server. I need to know if the code will drastically change if I update to R7. For example this is one of my login queries:
Would I just have to move all that in to the callback? Does mysql_fetch_field_row and mysql_store_result work for threaded queries? I assume so?
pawn Код:
new resultline[64];
format(querystring,sizeof(querystring), "SELECT Skin, IP, logincam, vcolor, vcolor2, time_h, time_m, weather FROM players WHERE Name = '%s' LIMIT 1", pName[playerid]);
mysql_query(querystring);
mysql_store_result();
mysql_fetch_row_format(resultline);
mysql_fetch_field_row(querystring, "Skin");
SetPVarInt(playerid, "Skin", strval(querystring));
SetPVarInt(playerid, "TempSkin", strval(querystring));
SetPlayerSkin(playerid, strval(querystring));
mysql_fetch_field_row(querystring, "vcolor");
SetPVarInt(playerid, "vcolor", strval(querystring));
mysql_fetch_field_row(querystring, "vcolor2");
SetPVarInt(playerid, "vcolor2", strval(querystring));
mysql_fetch_field_row(querystring, "logincam");
SetPVarInt(playerid, "logincam", strval(querystring));
mysql_fetch_field_row(querystring, "IP");
SetPVarString(playerid, "temp_ip", querystring);
mysql_fetch_field_row(querystring, "time_h");
if(strval(querystring) != -1) curPlayerHour[playerid] = strval(querystring);
else curPlayerHour[playerid] = DEFAULT_HOUR;
SetPVarInt(playerid, "time_h", curPlayerHour[playerid]);
mysql_fetch_field_row(querystring, "time_m");
if(strval(querystring) != -1) curPlayerMin[playerid] = strval(querystring);
else curPlayerMin[playerid] = DEFAULT_MIN;
SetPVarInt(playerid, "time_m", curPlayerHour[playerid]);
mysql_fetch_field_row(querystring, "weather");
if(strval(querystring) != -1) curPlayerWeather[playerid] = strval(querystring);
else curPlayerWeather[playerid] = DEFAULT_WEATHER;
SetPVarInt(playerid, "save_weather", curPlayerWeather[playerid]);
mysql_free_result();