NYCPHP Meetup

nested objects

Michael Welsh welsh_michael at hotmail.com
Mon Feb 10 18:57:34 EST 2003


Can I create an object that, in turn, creates another object within one of 
its functions?

I have a db_class that accepts an SQL statement.  It creates a connection 
thru ODBC and returns a recordset.  I have a foo_class that (tries to) call 
the db_class to fill itself up.  The main PHP page creates a new foo then 
does something like new_foo->get_data.

Procedurally, it works.  I did that to test the syntax and the ODBC call.  
But, when I nest the objects the db_class fails saying Unknown fucntion: 
odbc_exec.  It *appears* that it does not have a valid conn_id.

I probably didn't explain this well, but, I wanted to make sure I wasn't 
breaking any obvious rules before I posted examples.

Am I on the right track?  Thanks for any help.
Michael

_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail




More information about the talk mailing list