Hi Barry,

I do not know what do you use for feeding your database, but in Perl you
shoud use the DBI module, and insert the binary data through bindings.

use DBI;
use strict;

...

my $dbh = DBI->connect("dbi:mysql:image_db", "user", "password") || die
"$DBI::errstr\n";                                       # connect to the database

...

my $sth = $dbh->prepare("INSERT jpeg_table SET size_x = $size_x, size_y =
$size_y, image_data = ?;") || die "$DBI::errstr\n";     # prepare the insert
statement, replacing the image data with a question mark
$sth->bind_param(1, $image_data);                       # binding the binary data
$sth->execute() || die "$DBI::errstr\n";                # executing the insert

...

$dbh->disconnect();                                     # disconnect

Regards,

Peter Szekszardi
PortoLogic Ltd.
Portal building, design, net survey and more...

On Wed, 31 Jan 2001, Barry Radloff wrote:

> 
> 
> hi I am pretty new at this and would like to know how does one store a
> binary blob to the mysql DB ie I would like to store a jpeg to the db
> 
> Thanks
> 
> Barry Radloff
> R&D
> Media24
> 



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to