I am able to fetch a data from db not able to display in browser. below is the code-
my $q = CGI->new;
print $q->header,$q->start_html('testing');
my $title = $q->param('title');
my $perl = "";
#these is displayed properly
print "<font color=blue><b>TITLE:\"$title\"</b><br>";
print "<font color=blue><b>SCRIPT:\"$title\"</b>\n";
my $dbh = DBI->connect("DBI:ODBC:test","username","password") || die "Connection error: $DBI::errstr\n";
my $sql = "select * from tablename where title = '$title'";
my $sth = $dbh->prepare($sql);
$sth->execute;
my @row = $sth->fetchrow_array;
for(my $i=1;$i<=@row;$i++)
{
if($i == 5)
{
$perl = "$row[$i]";
}
}
#below is not displayed in browser
print $q->strong($title);
print $q->strong($perl);
$sth->finish();
$dbh->disconnect;
print $q->end_html;
I just want to print the value of $title and $perl in browser. this program is running properly but cant able to display value of $title and $perl
";` works but `print $q->strong($title);` doesn't, since they use the same variables. – Quentin Feb 11 '14 at 07:16