bool and mysql - 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: bool and mysql (
/showthread.php?tid=327930)
bool and mysql -
Larry123 - 23.03.2012
Hello, if i have in CarInfo enum:
And then i want to load it from mysql data:
Код:
mysql_fetch_field_row(Data, "EngineStatus"); CarInfo[i][EngineStatus] = strval(Data);
Then i get this warn
Warning 213: tag mismatch
What can be the fix
Re: bool and mysql -
ikkentim - 23.03.2012
Are youdefining data as an array?( new Data[64]; )
You should do so
Re: bool and mysql -
Larry123 - 23.03.2012
Yes i have
This warning is only there where is bool:
Re: bool and mysql -
Larry123 - 23.03.2012
can anyone help me ?
Re: bool and mysql -
ikkentim - 23.03.2012
Not sure if it works, but give it a try.
U guess your databases passes an 1 or an 0
CarInfo[i][EngineStatus] = (strval(Data) == 1) ? TRUE : FALSE;
Ps. do not bump in only 9 minutes. This is agains the rules
Re: bool and mysql -
Larry123 - 23.03.2012
Hmm now it is:
Код:
mysql_fetch_field_row(Data, "EngineStatus"); CarInfo[load][EngineStatus] = (strval(Data) == 1);
But now the 'EngineStatus' is always 1, isn`t it ?.