|< 1 2 >| | 14 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
sub new
{
my ($class,$db) = @_;
my $self = {};
bless $self, $class;
$self->{db} = $db;
return $self;
}
return $self->{"db"}->prepare($query);
1
2
3
4
sub _prepare($) {
my ($self,$query) = @_;
return $self->{db}->prepare($query);
} # end private method
1
2
my $db = new mysql(DBI->connect("DBI:mysql:$database",$username,$password));
$db->_prepare("SELECT * FROM table WHERE id = ?");
1
2
3
4
5
6
sub query($) {
my ($self,$query) = @_;
$self->{"query"} = $self->_prepare($query);
$self->_execute;
return 1;
} # end public method
1
2
3
4
5
6
7
sub query($) {
my ($self,$query) = @_;
print "$self\n" and return 1;
$self->{"query"} = $self->_prepare($query);
$self->_execute;
return 1;
} # end public method
|< 1 2 >| | 14 Einträge, 2 Seiten |