10 $self->{database}=$conf{database};
11 $self->{dbhost}=$conf{dbhost};
12 $self->{dbport}=$conf{dbport};
13 $self->{dbuser}=$conf{dbuser};
14 $self->{dbpasswd}=$conf{dbpasswd};
16 $self->{dsn} = "DBI:mysql:database=$self->{database};host=$self->{dbhost};port=$self->{dbport}";
17 $self->{dbh} = DBI->connect($self->{dsn}, $self->{dbuser},$self->{dbpasswd});
23 my ($pointer,$numrows,$fields)=(${$rows}[0],${$rows}[1],${$rows}[2]);
25 return if $pointer == $numrows;
26 for (my $i=0; $i < $fields; $i ++){
27 my $field= @{$rows}[($pointer * $fields) + 3 + $i ];
28 push (@result, $field);
41 $numRows=$numFields=0;
42 $self->{sth}=$self->{dbh}->prepare($query);
43 $self->{sth}->execute(@params) ;
44 $numRows = $self->{sth}->rows;
46 return @rows unless $numRows>0;
47 $numFields = $self->{sth}->{'NUM_OF_FIELDS'};
48 push (@rows,0,$numRows,$numFields);
49 while(@row=$self->{sth}->fetchrow_array){
66 $numRows=$numFields=0;
67 $self->{sth} = $self->{dbh}->prepare($query);
68 return $self->{sth}->execute(@params) ;
73 return $self->{sth}->{mysql_insertid};