mysql r39-5
#1

Getting information, n other stuff.

In this part i'm showing the list of the players in the work/faction, it's ok in this part.

PHP код:
formatg_szBuffer500"SELECT * FROM `users` WHERE WorkId > '-1'");
new 
Cache:Data mysql_querydbHandleg_szBuffer );
new 
num cache_num_rows();
new 
wName[MAX_PLAYER_NAME], jobIdwWarnswContractstr[220], fstr[500], dStatus[20];
format(strsizeof(str),"Ћaidėjas\tStatusas\tĮspėjimų sk.\tKontrakto pabaiga\n"wNamedStatuswWarnslikusdata(wContract));
strcat(fstrstr);
for( new 
inumi++ ){
    
jobId cache_get_field_content_inti"WorkId" );
    
wWarns cache_get_field_content_inti"WorkWarns" );
    
wContract cache_get_field_content_inti"WorkContract" );
    
cache_get_field_contenti"pName"wName );
    if(
player[playerid][pWorkLeader] == jobId)
    {
        if(
GetPlayeridMid(wName) != INVALID_PLAYER_ID) { dStatus "prisijungęs"; } else { dStatus "atsijunges"; }
        
format(strsizeof(str),"%s,\t(%s),\t%i,\t%s\n"wNamedStatuswWarnslikusdata(wContract));
        
strcat(fstrstr);
    }
}
if(!
num){
    
SendError(playerid"jūsų frakcijoje nėra darbuotojų !");
    
cache_deleteData );
    return 
1;

PHP код:
[09:48:39] [DEBUGmysql_query connection1query"SELECT * FROM `users` WHERE WorkId > '-1'"use_cachetrue
[09:48:39] [DEBUGCMySQLQuery::Execute starting query execution
[09:48:39] [DEBUGCMySQLQuery::Execute query was successfully executed within 0.601 milliseconds
[09:48:39] [DEBUGCMySQLResult::CMySQLResult() - constructor called
[09:48:39] [DEBUGCMySQLHandle::SaveActiveResult cache saved (id13)
[
09:48:39] [DEBUGcache_get_row_count connection1
[09:48:39] [DEBUGcache_get_field_content_int row0field_name"WorkId"connection1
[09:48:39] [DEBUGCMySQLResult::GetRowDataByName row'0'field"WorkId"data"3"
[09:48:39] [DEBUGcache_get_field_content_int row0field_name"WorkWarns"connection1
[09:48:39] [DEBUGCMySQLResult::GetRowDataByName row'0'field"WorkWarns"data"0"
[09:48:39] [DEBUGcache_get_field_content_int row0field_name"WorkContract"connection1
[09:48:39] [DEBUGCMySQLResult::GetRowDataByName row'0'field"WorkContract"data"1522636574"
[09:48:39] [DEBUGcache_get_field_content row0field_name"pName"connection1max_len24
[09:48:39] [DEBUGCMySQLResult::GetRowDataByName row'0'field"pName"data"Snaky_Snakess"
[09:48:39] [DEBUGcache_get_field_content_int row1field_name"WorkId"connection1
[09:48:39] [DEBUGCMySQLResult::GetRowDataByName row'1'field"WorkId"data"3"
[09:48:39] [DEBUGcache_get_field_content_int row1field_name"WorkWarns"connection1
[09:48:39] [DEBUGCMySQLResult::GetRowDataByName row'1'field"WorkWarns"data"0"
[09:48:39] [DEBUGcache_get_field_content_int row1field_name"WorkContract"connection1
[09:48:39] [DEBUGCMySQLResult::GetRowDataByName row'1'field"WorkContract"data"1522060574"
[09:48:39] [DEBUGcache_get_field_content row1field_name"pName"connection1max_len24
[09:48:39] [DEBUGCMySQLResult::GetRowDataByName row'1'field"pName"data"Blatant_Snake"
[09:48:39] [DEBUGcache_delete cache_id13connection1
[09:48:40] [DEBUGCMySQLResult::~CMySQLResult() - deconstructor called
[09:48:40] [DEBUGCMySQLHandle::DeleteSavedResult result deleted 
It might sound weird, but spName[playerid] I'm writing from that script upper, till the first ",", it's much easier for me like that. And it works, so problem not here, I can see the online players information, but if player offline - "GetPlayeridMid(spName[playerid]) == INVALID_PLAYER_ID", this part doesn't even want to work. Not even giving a single print, the only print I get is printf("ERROR - - - Haven't found information ");, and the log about that:
PHP код:
[09:48:41] [DEBUGmysql_query connection1query"SELECT * FROM `users` WHERE WorkId > '-1'"use_cachetrue
[09:48:41] [DEBUGCMySQLQuery::Execute starting query execution
[09:48:41] [DEBUGCMySQLQuery::Execute query was successfully executed within 0.360 milliseconds
[09:48:41] [DEBUGCMySQLResult::CMySQLResult() - constructor called
[09:48:41] [DEBUGCMySQLHandle::SaveActiveResult cache saved (id13)
[
09:48:41] [DEBUGcache_get_row_count connection1
[09:48:41] [DEBUGcache_delete cache_id13connection1
[09:48:41] [DEBUGCMySQLResult::~CMySQLResult() - deconstructor called
[09:48:41] [DEBUGCMySQLHandle::DeleteSavedResult result deleted 
PHP код:
if(GetPlayeridMid(spName[playerid]) == INVALID_PLAYER_ID){
new 
jobIdwWarnswContract,workRankdStatus[20], str[450];
if(
GetPlayeridMid(spName[playerid]) != INVALID_PLAYER_ID) { dStatus "prisijungęs"; } else { dStatus "atsijungęs"; }
printf("loading information 1");
formatg_szBuffer500g_szBuffer"SELECT * FROM `users` WHERE `pName` = '%s'"spName[playerid]);
printf("loading information 2");
new 
Cache:Data mysql_querydbHandleg_szBuffer );
printf("loading information 3");
new 
num cache_num_rows();
printf("loading information 3");
if(
num == 1)
{
  
printf("loading information 4");
  
jobId cache_get_field_content_int0"WorkId" );
  
wWarns cache_get_field_content_int0"WorkWarns" );
  
wContract cache_get_field_content_int0"WorkContract" );
  
workRank cache_get_field_content_int0"WorkRank" );
  
format(str350"{ffffff}Informacija apie darbuotoją:\n \n{d8a9ff}•{ffffff} %s darbuotojas ( {d8a9ff}%s{ffffff} ),\n{d8a9ff}•{ffffff} darbuotojo turimi įsp. {d8a9ff}%i{ffffff},\n{d8a9ff}•{ffffff} Kontraktas baigiasi {d8a9ff}%s{ffffff},\n{d8a9ff}•{ffffff} ћaidėjo būsena {d8a9ff}%s{ffffff}",spName[playerid],getPlayerRank(jobIdworkRank),wWarnslikusdata(wContract), dStatus);
  
ShowPlayerDialog(playerid872DIALOG_STYLE_MSGBOX ,"Informacija apie darbuotoją"str"Atgal""");
  
cache_delete(Data);
  
printf("loading information 5");
}
else
{
  
SendError(playerid"duomenys neaptikti duomenų bazėje.");
  
printf("ERROR - - - Haven't found information "); // љita iљprintina
  
cache_delete(Data);

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)