mysql r5
#1

PHP код:
new jobIdwPointsworkRankwContractresultline[40], dStatus[20];
                        if(
GetPlayeridMid(spName[playerid]) != INVALID_PLAYER_ID) { dStatus "prisijungęs"; } else { dStatus "atsijungęs"; }
                        
format(g_szBuffersizeof(g_szBuffer),"SELECT WorkId,WorkContract,WorkWarns,WorkRank FROM users WHERE pName = '%s'"spName[playerid]);
                        
mysql_query(g_szBuffer);
                        
mysql_store_result();
                        
                        
sscanf(resultline,"p<|>iiii"jobIdwContractwPointsworkRank);
                        
printf("%i job id %i contract %i wPoints %i rank",jobIdwContractwPointsworkRank );
                        
                        
format(g_szBuffersizeof(g_szBuffer), "{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),wPointslikusdata(wContract), dStatus);
                        
ShowPlayerDialog(playerid872DIALOG_STYLE_MSGBOX ,"Informacija apie darbuotoją"g_szBuffer"Atgal""");
                        
mysql_free_result(); 
I dont know why, but the jobId is getting 0, but in mysql it is setted to 6.
Reply
#2

Well could you explain me what "p<|>" is?

if you remove this, does it still print the value to 0?

BTW: I think printf isnt really in use cause you dont print any float ^^
Reply
#3

p<|> splits the rows, so it's doesn't have anything in common I think.
Reply
#4

Alright nice to know, if you already tried to do it without p<|> then I dont really know what could fix this
Reply
#5

My only question is, why are you still stuck at MySQL R5, when R39 is out? There's tons of tutorials for R33+, and it's a lot easier to work with in my opinion.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)