Mark
This has come up before.
PHP retrieved the data from the database and even though the entry in
the database was boolean, PHP (Because it is a loosely typed language)
returned the entry as a string with the value of "0". When this was
returned, Flex coerced this string value to a boolean. As "0" is a non
empty string, Flex coerced it to true (Which is what it should do for
any non-empty string).
The "Fix" is to coerce the value to an int at the PHP end. For example:
$myObject->booleanField = (int)$row['booleanField'];
Now, when the number 0 comes in, Flex correctly coerces it to false.
HTH
Steve
--- In [email protected], Mark Hage <m.c.h...@...> wrote:
>
> Hi,
>
> I am trying to send a boolean from PHP to Flex.
> In PHP I query a MySQL database which in a column returns a boolean.
> In PHP I have class parameter where this boolean is saved.
>
> I use Zend_AMF to communicate with my Flex app.
>
> In Flex the PHP class is mapped to a AS class, which has the type
Boolean
> for this var.
>
> Now all values are true, but not in my database.
>
> How can this be? And how can I send the proper boolean variables?
>
> Thanx,
> Mark
>