DBI::Simple - Perl extension to allow easy DBI access


NAME

DBI::Simple - Perl extension to allow easy DBI access


SYNOPSIS

  use DBI::Simple;
  $dbi = DBI::Simple->connect('mysql:hostname=localhost;database=main', 'user', 'pass');
  $rs = $dbi->query('SELECT * FROM Users');
  while(!$rs->eof)
  {
          print "Client = " . $rs->client . "\n";
          print "ID = " . $rs->id . "\n";
          print "\n\n\n a list of all fields and their values:\n";
          print "$_ = $rs->{data}->{$_}\n" for keys(%{$rs->{data}});
          $rs->move_next;
            }
  $dbi->disconnect;


ABSTRACT

  DBI::Simple abstracts the internals of the DBI module.  It encapsulates the  DBI, so you retain all the 
  functionality of the DBI when using DBI::Simple.


DESCRIPTION

Any DBI function can be accessed by returning the DBI::Simple object's underlying database handle. This handle can be retrieved with the dbh function. The following functions are members of the DBI::Simple package:

connect

The connect function takes the same parameters as the corresponding DBI function. However, it is not necessary to specify "dbi:" in the string. That is, the strings "dbi:mysql:...." and "mysql:..." are equivalent.

dbh

The dbh method returns the underlying DBI database handle.

query($statement)

The query function returns the the DBI::Simple::Recordset manpage object that results from executing $statement.

DEPENDENCIES

Requires the DBI module and any necessary DBD drivers.

EXPORT

None by default. All functions are object-oriented.


TODO


SEE ALSO

the DBI::Simple::Recordset manpage, the DBI manpage, DBD::*


AUTHOR

Bill Atkins, <cpanNOSPAM@batkins.com>


COPYRIGHT AND LICENSE

Copyright 2003 by Bill Atkins

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.