I need to upload a file to a database. Could someone tell me how to do it? I know how
to insert values into a table and upload files to a directory but how to combine the
two correctly so the file gets uploaded to my MySql DB and I don't get any errors. A
part of a script that does that would b
You mean something like this?
use DBI;
$dbh =
DBI->connect("DBI:mysql:database=mydatabase;host=localhost",
"user", "password", {'RaiseError' => 1});
$sth = $dbh->prepare("LOAD DATA INFILE '/home/me/file'
INTO TABLE mytable FIELDS TERMINATE
D BY '|'");
$sth->execute();
Priss
--- Mariusz <[EMA
Sorry, a bit messy...
use DBI;
$dbh =
DBI->connect("DBI:mysql:database=mydatabase;host=localhost",
"user", "password", {'RaiseError' => 1});
$sth = $dbh->prepare("LOAD DATA INFILE '/home/me/file'
INTO TABLE mytable FIELDS TERMINATED BY '|'");
$sth->execute();
Priss
--- Priss <[EMAIL PROTECTED
db) to my visitors... how can I
accomplish that? do I have to upload their file first to the host and then
to my db?
thanks
M
- Original Message -
From: "Priss" <[EMAIL PROTECTED]>
To: "perl" <[EMAIL PROTECTED]>
Sent: Saturday, September 21, 2002 3:02 AM
Subject:
delete the file when you
delete the record.
Hope this helps . . .
-- John
> -Original Message-
> From: Mariusz [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 20, 2002 8:35 PM
> To: perl
> Subject: file upload to MySql
>
>
> I need to upload a file to a databa