connect to your mysql server
select the mysql database
$query = "LOAD DATA INFILE "datafile.csv" INTO mytable ".
"FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' ".
"LINES TERMINATED BY '\n' ";
mysql_query($query) or die("error:". mysql_error());
-----Original Message-----
From: Thomas Edison Jr. [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 12, 2002 1:11 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Re-Importing .CSV file into Database
I have space on a server on the internet. I have mySQL
& PHP4 support. And i can easily upload the .CSV files
on the server itself.
Could you kindly help me out with the php code that
would make this possible..
Thanks,
T. Edison jr.
--- Rick Emery <[EMAIL PROTECTED]> wrote:
> The file is located on the server and you have
> access to it, yes. If the
> file is on the client, then no
>
> -----Original Message-----
> From: Thomas Edison Jr.
> [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 12, 2002 12:21 PM
> To: Rick Emery
> Subject: RE: [PHP] Re-Importing .CSV file into
> Database
>
>
> HI,
>
> Thanks.. i will try this. But tell me, can this same
> be executed through a php page rather than the mySQL
> command line?
>
> T. Edison Jr.
>
> --- Rick Emery <[EMAIL PROTECTED]> wrote:
> > look at MYSQL's LOAD DATA INFILE command:
> >
> > LOAD DATA INFILE "datafile.csv" INTO mytable
> FIELDS
> > TERMINATED BY ','
> > OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY
> '\n'
> >
> > -----Original Message-----
> > From: Thomas Edison Jr.
> > [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, February 12, 2002 12:02 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Re-Importing .CSV file into
> Database
> >
> >
> > Glory!
> >
> > I have a bunch of .CSV (Microsoft Excel Comma
> > Seperated Values) Files with me, whose data i want
> > to
> > put back into my mySQL database tables. How can i
> do
> > that through php? or otherwise...
> >
> > thanks,
> > T. Edison jr.
> >
> >
> > =====
> > Rahul S. Johari (Director)
> > ******************************************
> > Abraxas Technologies Inc.
> > Homepage : http://www.abraxastech.com
> > Email : [EMAIL PROTECTED]
> > Tel : 91-4546512/4522124
> > *******************************************
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Send FREE Valentine eCards with Yahoo! Greetings!
> > http://greetings.yahoo.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
> >
>
>
> =====
> Rahul S. Johari (Director)
> ******************************************
> Abraxas Technologies Inc.
> Homepage : http://www.abraxastech.com
> Email : [EMAIL PROTECTED]
> Tel : 91-4546512/4522124
> *******************************************
>
> __________________________________________________
> Do You Yahoo!?
> Send FREE Valentine eCards with Yahoo! Greetings!
> http://greetings.yahoo.com
=====
Rahul S. Johari (Director)
******************************************
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : [EMAIL PROTECTED]
Tel : 91-4546512/4522124
*******************************************
__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php