does your solution require the file to be sitting on the host where the
MySql is? If so, is there also an option of uploading it straight from the
user's computer?
I'm trying to give an option of uploading a picture (and I want to store it
with the rest of my record in the MySql 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: Re: file upload to MySql


> 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]
>

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

Reply via email to