programming-examples/perl/Database/Select, Execute, and Dump the Results.pl
2019-11-15 12:59:38 +01:00

10 lines
253 B
Perl

use DBI;
$db=DBI->connect('DBI:mysql:sample_db;user=root;password=');
$sth=$db->prepare("SELECT * FROM employee") or die "Can't prepare sql statement" . DBI->errstr;
$sth->execute();
$sth->dump_results();
$sth->finish();
$dbh->disconnect();