31.01.2014, 02:25
I had very strange results with R35 on a simple SELECT query:
And
(The last one used cache_get_field_content_int but I changed it in order to see if the problem was with the function itself (it wasn't) )
And these are the DB and it's values:

It did work for the char_id with the class NOT NULL
These are the codes:
It is not a fault in my code I believe, because with the very same code it works perfectly at R34.
Код:
[00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "kills", connection: 1 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "kills", data: "1" [00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "score", connection: 1 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "score", data: "1" [00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "captures", connection: 1 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "captures", data: "0" [00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "defenses", connection: 1 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "defenses", data: "0" [00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "destructions", connection: 1 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "destructions", data: "0" [00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "assists", connection: 1 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "assists", data: "0" [00:23:11] [DEBUG] cache_get_field_content_float - row: 0, field_name: "damagedealt", connection: 1 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "damagedealt", data: "0" [00:23:11] [DEBUG] cache_get_field_content_float - row: 0, field_name: "healed", connection: 1 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "healed", data: "0" [00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "saps", connection: 1 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "saps", data: "0" [00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "backstabs", connection: 1 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "backstabs", data: "0" [00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "constructions", connection: 1 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "constructions", data: "0" [00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "headshoots", connection: 1 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "headshoots", data: "0" [00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "ubers", connection: 1 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ubers", data: "0" [00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "time", connection: 1 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "time", data: "0"
Код:
00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "kills", connection: 1, max_len: 12 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "kills", data: "0" [00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "score", connection: 1, max_len: 12 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "score", data: "0" [00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "captures", connection: 1, max_len: 12 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "captures", data: "0" [00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "defenses", connection: 1, max_len: 12 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "defenses", data: "0" [00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "destructions", connection: 1, max_len: 12 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "destructions", data: "0" [00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "assists", connection: 1, max_len: 12 [00:23:11] [DEBUG] CMySQLQuery::Execute[] - starting query execution [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "assists", data: "0" [00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "damagedealt", connection: 1, max_len: 12 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "damagedealt", data: "0" [00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "healed", connection: 1, max_len: 12 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "healed", data: "0" [00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "saps", connection: 1, max_len: 12 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "saps", data: "0" [00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "backstabs", connection: 1, max_len: 12 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "backstabs", data: "0" [00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "constructions", connection: 1, max_len: 12 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "constructions", data: "0" [00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "headshoots", connection: 1, max_len: 12 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "headshoots", data: "0" [00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "ubers", connection: 1, max_len: 12 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ubers", data: "0" [00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "time", connection: 1, max_len: 12 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "time", data: "0" [00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "criticals", connection: 1, max_len: 12 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "criticals", data: "2" [00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "victories", connection: 1, max_len: 12 [00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "victories", data: "6"
And these are the DB and it's values:

It did work for the char_id with the class NOT NULL
Код:
[00:23:13] [DEBUG] cache_get_field_content_int - row: 0, field_name: "time", connection: 1 [00:23:13] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "time", data: "565" [00:23:13] [DEBUG] cache_get_field_content_int - row: 0, field_name: "score", connection: 1 [00:23:13] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "score", data: "0" [00:23:13] [DEBUG] cache_get_field_content_int - row: 0, field_name: "kills", connection: 1 [00:23:13] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "kills", data: "0" [00:23:13] [DEBUG] cache_get_field_content_int - row: 0, field_name: "captures", connection: 1 [00:23:13] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "captures", data: "0" [00:23:13] [DEBUG] cache_get_field_content_int - row: 0, field_name: "destructions", connection: 1 [00:23:13] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "destructions", data: "0" [00:23:13] [DEBUG] cache_get_field_content_int - row: 0, field_name: "assists", connection: 1 [00:23:13] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "assists", data: "0" [00:23:13] [DEBUG] cache_get_field_content_int - row: 0, field_name: "defenses", connection: 1 [00:23:13] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "defenses", data: "0" [00:23:13] [DEBUG] cache_get_field_content_float - row: 0, field_name: "damagedealt", connection:
pawn Код:
stock LoadClassStats(playerid,classe, char_id)
{
if(GetPVarInt(playerid,"AccountLevel") == 0)
return 1;
mysql_format(dbHandle, query, 128, "SELECT * FROM `stats` WHERE `char_id` = %d AND `type` = 2 AND `class` = '%d' ", char_id ,classe);
mysql_tquery(dbHandle,query,"OnPlayerClassStatsLoad","ii",playerid,classe);
return 1;
}
stock LoadLiveStats(playerid, char_id)
{
if(GetPVarInt(playerid,"AccountLevel") == 0)
return 1;
mysql_format(dbHandle, query, 128, "SELECT * FROM `stats` WHERE `char_id` = '%d' AND `type` = 1",char_id);
mysql_tquery(dbHandle,query,"OnPlayerLiveStatsLoad","i",playerid);
return 1;
}
stock LoadStats(playerid, char_id)
{
if(GetPVarInt(playerid,"AccountLevel") == 0)
return 1;
mysql_format(dbHandle, query, 128, "SELECT * FROM `stats` WHERE `char_id` = '%d' AND `type` = 0",char_id);
mysql_tquery(dbHandle,query,"OnPlayerGlobalStatsLoad","i",playerid);
return 1;
}
forward OnPlayerClassStatsLoad(playerid,class);
public OnPlayerClassStatsLoad(playerid,class)
{
new rows, fields;
cache_get_data(rows, fields);
if(!rows)
{
if(GetPVarInt(playerid,"AccountLevel") >= 1)
TDError(playerid, "Could not load your class stats, contact the administrator.");
return 1;
}
if(class == SCOUT)
SetPVarInt(playerid, "PlayedScout",cache_get_field_content_int(0, "time"));
else if(class == PYRO)
SetPVarInt(playerid, "PlayedPyro",cache_get_field_content_int(0, "time"));
else if(class == SOLDIER)
SetPVarInt(playerid, "PlayedSoldier",cache_get_field_content_int(0, "time"));
else if(class == DEMOMAN)
SetPVarInt(playerid, "PlayedDemoman",cache_get_field_content_int(0, "time"));
else if(class == HEAVY)
SetPVarInt(playerid, "PlayedHeavy",cache_get_field_content_int(0, "time"));
else if(class == ENGINEER)
SetPVarInt(playerid, "PlayedEngineer",cache_get_field_content_int(0, "time")),
SetPVarInt(playerid, "CurrClassConstructions",cache_get_field_content_int(0, "constructions"));
else if(class == MEDIC)
SetPVarInt(playerid, "PlayedMedic",cache_get_field_content_int(0, "time")),
SetPVarFloat(playerid, "CurrClassHealed",cache_get_field_content_float(0, "healed")),
SetPVarInt(playerid, "CurrClassUbers",cache_get_field_content_int(0, "ubers"));
else if(class == SPY)
SetPVarInt(playerid, "PlayedSpy",cache_get_field_content_int(0, "time")),
SetPVarInt(playerid, "CurrClassBackstabs",cache_get_field_content_int(0, "backstabs")),
SetPVarInt(playerid, "CurrClassSaps",cache_get_field_content_int(0, "saps"));
else if(class == SNIPER)
SetPVarInt(playerid, "PlayedSniper",cache_get_field_content_int(0, "time")),
SetPVarInt(playerid, "CurrClassHeadshoots",cache_get_field_content_int(0, "headshoots"));
SetPVarInt(playerid, "CurrClassScore", cache_get_field_content_int(0, "score"));
SetPVarInt(playerid, "CurrClassVictims", cache_get_field_content_int(0, "kills"));
SetPVarInt(playerid, "CurrClassCaptures", cache_get_field_content_int(0, "captures"));
SetPVarInt(playerid, "CurrClassDestroyed", cache_get_field_content_int(0, "destructions"));
SetPVarInt(playerid, "CurrClassAssists", cache_get_field_content_int(0, "assists"));
SetPVarInt(playerid, "CurrClassDefenses", cache_get_field_content_int(0, "defenses"));
SetPVarFloat(playerid, "CurrClassDamage",cache_get_field_content_float(0, "damagedealt"));
return 1;
}
forward OnPlayerGlobalStatsLoad(playerid);
public OnPlayerGlobalStatsLoad(playerid)
{
new rows, fields;
cache_get_data(rows, fields);
if(!rows)
{
if(GetPVarInt(playerid,"AccountLevel") >= 1)
TDError(playerid, "Could not load your global stats, contact the administrator.");
return 1;
}
SetPVarInt(playerid, "Kills", cache_get_field_content_int(0, "kills"));
SetPVarInt(playerid, "Score", cache_get_field_content_int(0, "score"));
SetPVarInt(playerid, "Captures", cache_get_field_content_int(0, "captures"));
SetPVarInt(playerid, "Defenses", cache_get_field_content_int(0, "defenses"));
SetPVarInt(playerid, "Destroyed", cache_get_field_content_int(0, "destructions"));
SetPVarInt(playerid, "Assists", cache_get_field_content_int(0, "assists"));
SetPVarFloat(playerid, "DamageDone", cache_get_field_content_float(0, "damagedealt"));
SetPVarFloat(playerid, "HPHealed", cache_get_field_content_float(0, "healed"));
SetPVarInt(playerid, "Sapped", cache_get_field_content_int(0, "saps"));
SetPVarInt(playerid, "Backstabs", cache_get_field_content_int(0, "backstabs"));
SetPVarInt(playerid, "Constructions", cache_get_field_content_int(0, "constructions"));
SetPVarInt(playerid, "Headshoots", cache_get_field_content_int(0, "headshoots"));
SetPVarInt(playerid, "Ubers", cache_get_field_content_int(0, "ubers"));
SetPVarInt(playerid, "PlayingSecs", cache_get_field_content_int(0, "time"));
SetPVarInt(playerid, "Criticals", cache_get_field_content_int(0, "criticals"));
SetPVarInt(playerid, "Victories", cache_get_field_content_int(0, "victories"));
return 1;
}
forward OnPlayerLiveStatsLoad(playerid);
public OnPlayerLiveStatsLoad(playerid)
{
new rows, fields;
cache_get_data(rows, fields);
if(!rows)
{
if(GetPVarInt(playerid,"AccountLevel") >= 1)
TDError(playerid, "Could not load your live stats, contact the administrator.");
return 1;
}
SetPVarInt(playerid, "LiveVictims", cache_get_field_content_int(0, "kills"));
SetPVarInt(playerid, "LiveScore", cache_get_field_content_int(0, "score"));
SetPVarInt(playerid, "LiveCaptures", cache_get_field_content_int(0, "captures"));
SetPVarInt(playerid, "LiveDefenses", cache_get_field_content_int(0, "defenses"));
SetPVarInt(playerid, "LiveDestroyed", cache_get_field_content_int(0, "destructions"));
SetPVarInt(playerid, "LiveAssists", cache_get_field_content_int(0, "assists"));
SetPVarFloat(playerid, "LiveDamage", cache_get_field_content_float(0, "damagedealt"));
SetPVarFloat(playerid, "LiveHealed", cache_get_field_content_float(0, "healed"));
SetPVarInt(playerid, "LiveSaps", cache_get_field_content_int(0, "saps"));
SetPVarInt(playerid, "LiveBackstabs", cache_get_field_content_int(0, "backstabs"));
SetPVarInt(playerid, "LiveConstructions", cache_get_field_content_int(0, "constructions"));
SetPVarInt(playerid, "LiveHeadshoots", cache_get_field_content_int(0, "headshoots"));
SetPVarInt(playerid, "LiveUbers", cache_get_field_content_int(0, "ubers"));
SetPVarInt(playerid, "LiveSecs", cache_get_field_content_int(0, "time"));
return 1;
}
Код:
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "kills", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "kills", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "score", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "score", data: "1" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "captures", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "captures", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "defenses", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "defenses", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "destructions", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "destructions", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "assists", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "assists", data: "0" [00:31:42] [DEBUG] cache_get_field_content_float - row: 0, field_name: "damagedealt", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "damagedealt", data: "0" [00:31:42] [DEBUG] cache_get_field_content_float - row: 0, field_name: "healed", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "healed", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "saps", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "saps", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "backstabs", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "backstabs", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "constructions", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "constructions", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "headshoots", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "headshoots", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "ubers", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ubers", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "time", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "time", data: "297" [00:31:42] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [00:31:42] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called [00:31:42] [DEBUG] Calling callback "OnPlayerGlobalStatsLoad".. [00:31:42] [DEBUG] cache_get_data - connection: 1 [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "kills", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "kills", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "score", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "score", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "captures", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "captures", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "defenses", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "defenses", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "destructions", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "destructions", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "assists", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "assists", data: "0" [00:31:42] [DEBUG] cache_get_field_content_float - row: 0, field_name: "damagedealt", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "damagedealt", data: "0" [00:31:42] [DEBUG] cache_get_field_content_float - row: 0, field_name: "healed", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "healed", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "saps", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "saps", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "backstabs", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "backstabs", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "constructions", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "constructions", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "headshoots", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "headshoots", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "ubers", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ubers", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "time", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "time", data: "365" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "criticals", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "criticals", data: "0" [00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "victories", connection: 1 [00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "victories", data: "0"