This is not a Bridge problem, more of a question. I am using the Java
Bridge to access database servers from PHP. Type casting is driving me
nuts. Does anyone have a preferred method of handling this?
Should PHP handle everyting as a string and type casting be done in Java?
I find the types are "difficult" when trying to pass objects. Should
everything be handled as primitives?
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. I have tried several different approaches and
so far it isn't happy.
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:
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.
Get latest updates about Open Source Projects, Conferences and News.