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
connectfunction 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
dbhmethod returns the underlying DBI database handle. query($statement)-
The
queryfunction returns the DBI::Simple::Recordset 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
Update database when members of hash are changed
Cache prepared statements for better performance
Enable transaction-based updating
Create tests.
Insert and Delete methods
SEE ALSO
DBI::Simple::Recordset, DBI, 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.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 152:
Unknown directive: =iem