xspikx has asked for the wisdom of the Perl Monks concerning the following question:
Can anybody give me any idea of how to do it properly. thanks.open(TARFILE, "< $domain_path/$file_name"); while(<TARFILE>) { $filedata = $filedata . $_; } $db_handle = DBI->connect('DBI:mysql:PMCONTROL:host:port', 'db', 'pass +word', { RaiseError => 1, AutoCommit => 1}); my $sth = $db_handle->prepare("insert into LOGS (Domain, ID, Batch, LO +G_Type, File_name, Comment, File_Data) values(?,?,?,?,?,?,?)"); $sth->execute($doma, $d_id, $entry->{batch}, $entry->{log_type}, $file +_name, $entry->{comment}, $filedata); $sth->finish(); $db_handle->disconnect();
Edit by BazB: remove user, host, database and password info.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl to upload blob file to Mysql
by rnahi (Curate) on Aug 29, 2005 at 18:03 UTC | |
by xspikx (Acolyte) on Aug 29, 2005 at 18:07 UTC | |
|
Re: Perl to upload blob file to Mysql
by cfreak (Chaplain) on Aug 29, 2005 at 17:52 UTC | |
by xspikx (Acolyte) on Aug 29, 2005 at 18:05 UTC | |
|
Re: Perl to upload blob file to Mysql
by fmerges (Chaplain) on Aug 29, 2005 at 18:19 UTC | |
by xspikx (Acolyte) on Aug 29, 2005 at 18:42 UTC | |
by blazar (Canon) on Aug 31, 2005 at 09:39 UTC | |
|
Re: Perl to upload blob file to Mysql
by jZed (Prior) on Aug 29, 2005 at 17:56 UTC |