in reply to Re^3: Mysql and Images
in thread Mysql and Images
But as said before - its just easy to handle. You don't have to care about potential security headaches with uploading binary files into your cgi-dir, permissions etc. Just 'insert' and 'select', and there you (should) go. And i still have to get the content-type, either by extracting it from the image (bad idea) or by getting it from the Database.
Some more Information about my problem:
System is a current Gentoo-Linux with perl 5.8.6, mysql-4.1.14, DBD::Mysql 2.9007, DBI 1.46.
When using the console-client 'mysql', everything works as expected. Same with phpMyAdmin.
The following code also works:
my $sql = "select type from bilder where id =?"; my $sth = $dbh->prepare($sql); $sth->execute( $q->param('id') ); my $error = 0; my $type = $sth->fetchrow || ( $error = 1 ); $sql = "select data from bilder where id =?"; $sth = $dbh->prepare($sql); $sth->execute( $q->param('id') ); my $data = $sth->fetchrow(); binmode(STDOUT); ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Mysql and Images
by gloryhack (Deacon) on Dec 19, 2005 at 20:38 UTC | |
by Braindead_One (Monk) on Dec 22, 2005 at 07:52 UTC |