in reply to Animating images from database

#!/usr/bin/perl use CGI; #Hate this use DBI; print "Content-type: image/jpeg\n\n"; binmode STDOUT; #win32; my $dbh = DBI->connect("relevant stuff here"); my $image_date; my $sth = $dbh->prepare("SELECT data FROM images WHERE id=?"); $sth->execute( param('img') ); $sth->bind_column( \$image_data ); #erm. I think $sth->fetch; $sth->finish; $dbh->disconnect; print $image_data; #done

Replies are listed 'Best First'.
Re^2: Animating images from database
by davido (Cardinal) on Jan 21, 2005 at 05:50 UTC

    I think that if you're not going to use the OO interface to CGI, you have to specify "use CGI qw( :standard ); for the param() subroutine to be exported (and thus available to your main script).


    Dave