|
From: <php...@li...> - 2009-01-05 13:42:56
|
I think found what was causing my confusion. On the SQL Server the field
that I thought was a double is actually defined as a Money type. If I
understand it correctly, the Money type is a long integer that has to be
scaled based on the definition.
Thanks for your reply. I suspected that PHP only really used strings, but
wasn't sure. Also, I had forgotten about the java_values command. I have
used it before, but it has been some time.
Thanks Jost.
Charles Shaffer
Senior Analyst
NTN-Bower Corporation
php...@li...
01/03/2009 11:00 AM
Please respond to php-java-bridge-users
To: php...@li...
cc:
Subject: Re: [Php-java-bridge-users] Type Casting
Hi,
can you please give an example which demonstrates the problem?
> Should PHP handle everyting as a string and type casting be
> done in Java?
That's the only type that PHP supports, anyway. :)
> For example I have a Sql query being called from Java. PHP
> passes a
> string and an int to the Java routine and the Java routine
> runs the SQL query and returns a double.
The bridge will return a proxy for the result, which can be evaluated as
usual:
either
echo (int)(string)$sqlResult;
or
echo java_values($sqlResult);
Note that the first line above might be wrong on 32 bit machines, where
PHP int values have a limited range. Use (double)(string)$sqlResult
instead.
Regards,
Jost Boekemeier
------------------------------------------------------------------------------
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
|