Select, Execute, and Dump the Results : select « Database « Perl






Select, Execute, and Dump the Results

   

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();

   
    
    
  








Related examples in the same category

1.Select, Execute, and Fetch a Row as a Hash
2.Select, Execute, and Fetch a Row as an Array
3.Simple query
4.The First SQL Query
5.Using a Placeholder
6.Creating a Web Page Integrated with SQL Data
7.Creating an HTML Table