tags:

views:

10

answers:

0

I'm trying to bind some variables to a db2 query using db2_bind_param, but they're stored in an object and assigning them to temporary vars offends me. Is there a method of passing $obj->func($var) or $obj->property to the db2_bind_param function?

eg. Works:

db2_bind_param($SQLStmt, 1, "var1", DB2_CHAR);
...
db2_execute($SQLStmt);

Doesn't:

db2_bind_param($SQLStmt, 1, "obj->property", DB2_CHAR);
db2_bind_param($SQLStmt, 1, "\$obj->property", DB2_CHAR);
db2_bind_param($SQLStmt, 1, "{\$obj->property}", DB2_CHAR);
db2_bind_param($SQLStmt, 1, "obj['property']", DB2_CHAR);
...
db2_execute($SQLStmt);

Is this possible?