#!/usr/bin/perl -w #use CGI::Debug; use strict; use CGI; use DBI; my $q = new CGI; my $dbh = DBI->connect("DBI:mysql:database=test","test",""); my $sth = $dbh->prepare("select * from tab1"); $sth->execute; print $q->header, $q->start_html('test baze'), $q->start_table({-border=>undef}); while(my $ref = $sth->fetchrow_arrayref) { print $q->Tr({-align=>'center'},$q->td($$ref[0]),$q->td($$ref[1])); } $q->end_table; $q->end_html; $sth->finish; $dbh->diconnect;