#!C:\perl\bin\perl use strict; use CGI; use DBI; my $q = new CGI; print $q->header("text\html"), $q->start_html(-title=>"test"); my $dbh = DBI->connect("DBI:mysql:te:localhost", {PrintError =>0, RaiseError =>0}) ; #automatic error checking #DBI->trace(2); my $data = qq(select sl_no, name from det order by name); my $sth = $dbh->prepare($data); $sth->execute; #while ( ( $sno, $name) = $sth->fetchrow_array ) { # ### Print out a wee message.... # #print "Name is $sno\t$name\n"; #} $dbh->disconnect; print $q->p("$sno, $name"); print $q->end_html;