PDA

View Full Version : mysql r5


bogushas
06/02/2015, 06:08 AM
new jobId, wPoints, workRank, wContract, resultline[40], dStatus[20];
if(GetPlayeridMid(spName[playerid]) != INVALID_PLAYER_ID) { dStatus = "prisijungęs"; } else { dStatus = "atsijungęs"; }
format(g_szBuffer, sizeof(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", jobId, wContract, wPoints, workRank);
printf("%i job id %i contract %i wPoints %i rank",jobId, wContract, wPoints, workRank );

format(g_szBuffer, sizeof(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(jobId, workRank),wPoints, likusdata(wContract), dStatus);
ShowPlayerDialog(playerid, 872, DIALOG_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.

Saize
06/02/2015, 06:47 AM
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 ^^

bogushas
06/02/2015, 06:49 AM
p<|> splits the rows, so it's doesn't have anything in common I think.

Saize
06/02/2015, 06:51 AM
Alright nice to know, if you already tried to do it without p<|> then I dont really know what could fix this

Knappen
06/02/2015, 10:40 AM
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.