in reply to Object Oriented Pattern help
For 2), you can create a function "dbi()", which when called, either creates the $dbi connection if none exists and returns it, or returns the existing dbi connection. Then in your various classes in Guest, call something like:
You no longer need to pass the $dbi to each method.my $sth = Controller->dbi()->prepare( "SQL STATEMENT" ) or die DBI->errstr;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: (Zigster)Object Oriented Pattern help
by zigster (Hermit) on May 13, 2001 at 15:40 UTC | |
by tilly (Archbishop) on May 13, 2001 at 17:40 UTC | |
by zigster (Hermit) on May 14, 2001 at 00:30 UTC | |
by tilly (Archbishop) on May 14, 2001 at 01:27 UTC | |
by zigster (Hermit) on May 14, 2001 at 14:28 UTC | |
|