php-general | 2001032
Date: 03/21/01
- Next message: Keith Vance: "Re: [PHP] Pre-Written Script ?"
- Previous message: ..s.c.o.t.t..: "RE: [PHP] Pre-Written Script ?"
- In reply to: Tobias Talltorp: "[PHP] linking classes together"
- Next in thread: Stewart Taylor: "RE: [PHP] linking classes together"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 class member variable.
> function sessions {
> $db = new mysql_connect;
$this->db = new mysql_connect;
> }
>
> function testprint() {
> $db-> connect()
$this->db->connect();
> }
Regards,
-- Yasuo Ohgaki> $sess = new sessions; > $sess-> testprint(); > > Any thoughts? > // Tobias > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe <email protected> > For additional commands, e-mail: php-general-help <email protected> > To contact the list administrators, e-mail: php-list-admin <email protected> >
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Keith Vance: "Re: [PHP] Pre-Written Script ?"
- Previous message: ..s.c.o.t.t..: "RE: [PHP] Pre-Written Script ?"
- In reply to: Tobias Talltorp: "[PHP] linking classes together"
- Next in thread: Stewart Taylor: "RE: [PHP] linking classes together"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

