SA-MP Forums Archive
MySQL fetching a boolean value - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL fetching a boolean value (/showthread.php?tid=559712)



MySQL fetching a boolean value - dominik523 - 24.01.2015

Hey all! I tried to find a function for fetching a boolean value from a cache and I haven't found a solution yet.
I'm using the latest MySQL plugin from BlueG and I've only found functions for getting an integer and float values and strings. (cache_get_field_content and other functions)
Can someone tell a proper way to do this? Thank you!


Re: MySQL fetching a boolean value - Sime30 - 24.01.2015

Probaj ovo...(Try this...)

pawn Code:
new bool:test;
test =!!cache_get_field_content_int(0, "test");
OR

pawn Code:
new bool:test;

if(cache_get_field_content_int(0, "test")) test = true;
else test = false;



Re: MySQL fetching a boolean value - dominik523 - 25.01.2015

Alright, thanks for the answer!
I should read other posts where people asked the same question, and Vince told the answer on one of the threads so here's the solution:
pawn Code:
PlayerInfo[playerid][pShoot] = bool:cache_get_field_content_int(0, "ShootInd", mysql);



Re: MySQL fetching a boolean value - Sime30 - 25.01.2015

No problem, glad you fixed your issue