RE: [PHP] linking classes together

2001-03-22 Thread Stewart Taylor
Your need to define $db as a property of your sessions class. e.g. class sessions { var $db; function sessions { $this->db = new mysql_connect; } function testprint() { $this->db->connect() } } $sess = new sessions; $sess-> testprint(); -Original Message-

Re: [PHP] linking classes together

2001-03-21 Thread Yasuo Ohgaki
SNIP > // This does not work --> > class sessions { > function sessions { > $db = new mysql_connect; > } > > function testprint() { > $db-> connect() > } > } This does not work as it shouldn't. You create $db in another function => other function cannot use. Make it