I want to start learning Class::DBI and put the default DBI aside for a while. I created this method that does a simple select, I want to learn how to do it the Class::DBI way.
Here's my method doing it the old fashion way.
# DATA SOURCE NAME
my $dsn = "dbi:mysql:$dbname:localhost:3306";
# PERL DBI CONNECT
my $connect = DBI->connect($dsn, $user, $pw);
my $query = "SELECT username, password, created FROM TempAccountRegist
my $query_handle = $connect->prepare($query);
# EXECUTE THE QUERY
# BIND TABLE COLUMNS TO VARIABLES
$query_handle->bind_columns(\$username, \$password, \$created);
# LOOP THROUGH RESULTS
print DB "$username, $password, $created\n";
I have another file with Class::DBI
use base 'Class::DBI';
DataStore::DAO::Base->connection("dbi:$source:$dbname", $user, $passwo
# I would like to add the method doing it the Class::DbI
# way here.
Where I work, they strive on Class:DBI, so I'm eager to learn it.
Thanks for your help.