14.01.2015, 19:14
I am trying to get a value for playerDays from my database but it's saying 0 in-game.
I am using mysql r39-2 and i am getting those errors in mysql_log:
My code is:
Thanks for helping me! I rep!
I am using mysql r39-2 and i am getting those errors in mysql_log:
pawn Код:
[21:46:57] [WARNING] cache_get_field_content - no active cache
pawn Код:
else
{
new query2[1000];
new dstring[500];
new query[1000];
new days;
new playerID = cache_get_row_int(0, 0);
mysql_format(handle, query2, sizeof(query2), "SELECT `playerID` FROM `playeraccounts` WHERE `playerName` = '%s' LIMIT 1",playerVariables[playerid][pSelected]);
mysql_tquery(handle, query2);
mysql_format(handle, query, sizeof(query), "SELECT playerDays FROM playeraccounts WHERE playerID = '%d' ", playerID);
new Cache: result690 = mysql_query(handle, query);
cache_get_field_content(0, "playerDays", query2);
days = strval(query2);
format(dstring, sizeof(dstring), "%s has left the faction with %d days.",playerVariables[playerid][pSelected], days);
SCM(playerid, -1 , dstring);
cache_delete(result690);
}