in reply to DBH Insert of Binary Data
For this sort of thing you'll want to bind the values.
my $sth = $dbh->prepare("INSERT INTO `table` (`blobcolumn`) VALUES ( ? )"); $sth->execute($bindata) or die $dbh->errstr;
The "?" gets replaced by your $bindata when the query executes, and DBI takes care of everything for you. (This feature also allows you to prepare a statement handle once and execute it several times with changing values.)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: DBH Insert of Binary Data
by cowboy (Friar) on Mar 19, 2005 at 03:13 UTC | |
Re^2: DBH Insert of Binary Data
by Hero Zzyzzx (Curate) on Mar 18, 2005 at 20:40 UTC | |
by jZed (Prior) on Mar 18, 2005 at 20:56 UTC | |
by Joost (Canon) on Mar 18, 2005 at 22:28 UTC | |
by jZed (Prior) on Mar 18, 2005 at 22:55 UTC | |
by Joost (Canon) on Mar 19, 2005 at 01:36 UTC | |
|
In Section
Seekers of Perl Wisdom