file upload to MySql

2002-09-20 Thread Mariusz
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

Re: file upload to MySql

2002-09-21 Thread Priss
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

Re: file upload to MySql

2002-09-21 Thread Priss
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

Re: file upload to MySql ??

2002-09-21 Thread Mariusz
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

2002-09-21 Thread John Almberg
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