bool and mysql
#1

Hello, if i have in CarInfo enum:

Код:
bool:EngineStatus,
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
Reply
#2

Are youdefining data as an array?( new Data[64]; )
You should do so
Reply
#3

Yes i have

This warning is only there where is bool:
Reply
#4

can anyone help me ?
Reply
#5

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
Reply
#6

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 ?.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)