in reply to Re: Images
in thread Images

Hi, Thanks for your kind response. I've changed my code.but still ....can't get it. my new code is aas follows...
#!/usr/bin/perl use strict; use DBI; my ($user,$password,$sno,$name,$datasource,$h); $user="mydb1"; $password="mydb1"; print "Content-type:text/html\n\n"; my $h = qq{<html><body>}; my $dbh = DBI->connect("dbi:mysql:mydb", $user, $password) or die "Can +'t connect to "; my $sth = $dbh->prepare( q{SELECT sno, name FROM IMAGE}) or die "Can't + prepare statement: $DBI::errstr"; my $rc = $sth->execute or die "Can't execute statement: $DBI::errstr +"; while ( my($sno, $name) = $sth->fetchrow() ) { $h .= qq{$name}; } $sth->finish; print $h; print "</body></html>\n"; $dbh->disconnect;
The images are not appearing .

Edit kudra, 2002-10-27 Code tags

Replies are listed 'Best First'.
Re: Re: Re: Images
by sch (Pilgrim) on Oct 25, 2002 at 10:41 UTC

    Hi - in that code as far as I can see you're not generating any <IMG> tags. You should really look at CGI.pm but in the meantime changing

    print $h;

    to
    print "<IMG src=\"".$h."\">;
    may help.

    Hey, if there's code up ^^ there ^^, don't blame me if it doesn't work.

    But today you took me walking, Through a land that we have lost,
    While our children sit at websites, With no access to the cost