#!/usr/bin/perl use CGI qw(:standard); use strict; use warnings; use DBI; print "Content-type:text/html\n\n"; my $i; my $dbh= DBI->connect('DBI:mysql:databasename','root','password'); my $sth=$dbh->prepare("select * from emp_info"); $sth->execute(); print "
"; while(my @arr=$sth->fetchrow_array()) { print ""; print ""; print ""; print ""; } print "
Id = $arr[$i]Name = $arr[$i+1]Age = $arr[$i+2]Salary = $arr[$i+3]
";