DBI::Library - DBI subclass providing a dynamic SQL Libary.
FO Syntax
use DBI::Library qw(:all);
my $dbh = initDB({name => 'LZE',host => 'localhost',user => 'root',password =>'',style=> 'lze'});
OO Syntax
use DBI::Library;
my ($database,$dbh) = new DBI::Library( { name =>'LZE', host => 'localhost', user => 'root', password =>'', style=> 'lze' } ); my %execute = ( title => 'showTables', description => 'description', sql => "show tables", return => "fetch_array", ); $database->addexecute(\%execute); $database->showTables();
:all execute useexecute quote void fetch_hashref fetch_AoH fetch_array updateModules deleteexecute editexecute addexecute tableLength tableExists initDB
:dynamic execute useexecute void fetch_hashref fetch_AoH fetch_array updateModules deleteexecute editexecute addexecute
independent: tableLength tableExists initDB :dynamic
DBI::Library is a DBI subclass providing a dynamic SQL Libary.
my $database = new DBI::Library(); my ($database,$m_dbh) = new DBI::Library( { name => $db, host => $host, user => $m_sUser, password => $password, } );
my $dbh = initDB( { name => 'LZE', host => 'localhost', user => 'root', password =>'', } );
set or get the driver
Driver()
default: Mysql
gibt die aktuelle datenbank zurück
gibt den aktuellen host zurück
gibt den aktuellen user zurück
gibt das aktuelle passwort zurück
$bool = $database->tableExists($table);
$length = $database->tableLength($table);
add sql statments to yourdatabase for later use witdh useexecute();
my %execute = ( title => 'showTables', description => 'description', sql => "show tables", return => "fetch_array", ); $database->addexecute(\%execute); print join '<br/>' ,$m_oDatabase->showTables();
Fo Syntax:
print join '<br/>' , useexecute('showTables');
my %hash = ( title => 'Titel', newTitle => 'New Titel', description => 'querys Abfragen', sql => "sql statement", return => 'fetch_hashref', #subname ); editexecute(\%hash);
useexecute($m_sTitle,optional hashref {identifier => {1 => 'news', 2 => 'querys'} , @parameter);
example:
my %execute = ( title => 'joins', description => 'description', sql => 'select * from table_1 JOIN table_2 ', return => "fetch_hashref" ); $database->addexecute(\%execute5); my $ref = $database->joins({identifier => {1 => 'news', 2 => 'querys'}});
deleteexecute($title);
@A = $database->fetch_array($sql);
@aoh = $database->fetch_AoH($sql)
$hashref = $database->fetch_hashref($sql)
void(sql)
$quotedString = $database->quote($sql);
set a placeholder wihich is usesd by dynmaic statements.
<TABLE> will be replaced width this value.
default : querys;
statements add by addexecute can called like
$database->showTables()
Dirk Lindner <lze@cpan.org>
Copyright (C) 2005-2009 by Hr. Dirk Lindner
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'zurück'. Assuming UTF-8
To install MySQL::Admin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MySQL::Admin
CPAN shell
perl -MCPAN -e shell install MySQL::Admin
For more information on module installation, please visit the detailed CPAN module installation guide.