[SR-Users] About avp's, var's, null, 0 and empty string

Iñaki Baz Castillo ibc at aliax.net
Wed Sep 15 17:44:25 CEST 2010


2010/9/15 Juha Heinanen <jh at tutpro.com>:
> Iñaki Baz Castillo writes:
>
>> I retrieve the value of an integer column in a MySQL table. In this
>> case the value is NULL. I store the result in a $var:
>>
>>  $var(client_max_calls) = $dbr(client=>[0,0]);
>>
>> But the stored value is "" (empty string) rather than 0. Isn't a bit
>> confussing?
>
> inaki,
>
> yes, it is.
>
> have you tried what happens if you explicitly convert the rhs value to
> (int)?

No. I expect it becomes 0. But anyhow it seems for me like a
workaround on top of an unexpected behavior :)


-- 
Iñaki Baz Castillo
<ibc at aliax.net>



More information about the sr-users mailing list