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]> wrote: > 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 <[EMAIL PROTECTED]> wrote: > 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 be a great
> > help...
> > 
> > thank you,
> > M
> >  
> 
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
> 
> -- 
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>  

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to