#!/usr/bin/perl use CGI::Carp qw(fatalsToBrowser); use CGI qw(:standard :cgi-lib); use DBI; use strict; my $dbh = DBI->connect("DBI:mysql:database=DATABASE_NAME;host=10.10.10.10", "USER_HERE", "USER_HERE_PW", {'RaiseError' => 1}) or die $DBI->errstr; my $sth = $dbh->prepare (qq{ SELECT some_cell FROM `table_name` }); $sth->execute(); my $_content; while($_cell_whatever = $sth->selectrow_array()) { $_content .= $_cell_whatever . br() . "\n"; } $sth->finish(); print header(), start_html(), $_content, end_html();