in reply to Object Oriented Pattern help
As for the individual queries they should be either created with $dbh->prepare_cached('select...');, or stored in the object. This code may give an idea of what I mean.
sub delete { my $obj = shift; my $sth = $obj->{queries}{delete} || $obj->{dbh}->prepare( "DELETE FROM guest_list WHERE last_name = ? and first_names = ?" ); $sth->execute($obj->{_last_name}, $obj->{_first_names}); $obj->{queries}{delete} = $sth; return 1; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Object Oriented Pattern help
by steveAZ98 (Monk) on May 12, 2001 at 10:21 UTC | |
by koolade (Pilgrim) on May 12, 2001 at 18:04 UTC | |
Re: Re: Object Oriented Pattern help
by DrZaius (Monk) on May 13, 2001 at 02:28 UTC |