#! c:/perl/bin/perl.exe use CGI qw(:standard); use DBI; use CGI::Carp qw(warningsToBrowser fatalsToBrowser); $dbh = DBI->connect("DBI:mysql:database=perldbi;host=localhost","root",""); $sth = $dbh->prepare('select * from test'); $sth->execute(); print header; print start_html('Newgen Imaging Systems(P) Ltd.,'); print h1("Hello world"); if($sth->rows == 0) { print h1("YES"); } else { print h4("This is available table\n"); print "\n"; while( $resptr = $sth->fetchrow_hashref()) { print ""; print "
". $resptr->{"name"}; print "". $resptr->{"pass"}; print "\n"; print "<\/tr>"; } print "<\/table>\n"; } print "
"; print "
"; print "
"; print "\t\t"; print ""; $dbh->disconnect; print end_html;