cidaris has asked for the wisdom of the Perl Monks concerning the following question:
my $img = $query->upload('pc_img'); $img = <$img>; my $id = $query->param('pc_id'); my $sql = "INSERT INTO data_table (id, image) VALUES (?, ?); + ## id is BIGINT type, image is LONGBLOB type my $sth = $dbh->prepare($sql) or die "Couldn't prepare: $DBI::errstr\n +"; $sth->execute($id, $img) or die "Unable to execute query: $DBI::er +rstr\n"; $sth->finish; $dbh->disconnect;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Images into MySQL database
by blokhead (Monsignor) on Jan 23, 2003 at 01:33 UTC | |
Re: Images into MySQL database
by gmax (Abbot) on Jan 23, 2003 at 09:14 UTC | |
by cidaris (Friar) on Jan 23, 2003 at 09:50 UTC | |
Re: Images into MySQL database
by Gilimanjaro (Hermit) on Jan 23, 2003 at 01:43 UTC | |
OT: Images into MySQL database
by Ryszard (Priest) on Jan 23, 2003 at 07:00 UTC | |
by Coruscate (Sexton) on Jan 23, 2003 at 09:02 UTC | |
by CountZero (Bishop) on Jan 24, 2003 at 21:48 UTC | |
by Ryszard (Priest) on Jan 25, 2003 at 05:59 UTC | |
by CountZero (Bishop) on Jan 25, 2003 at 08:37 UTC |