RE: [PHP] Re-Importing .CSV file into Database
| From: | Rick Emery | Date: | Tue, 12 Feb 2002 19:24:28 +0000 |
| Subject: | RE: [PHP] Re-Importing .CSV file into Database | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-84427@lists.php.net to get a copy of this message | ||
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:thomasedisonjr@yahoo.com]
Sent: Tuesday, February 12, 2002 1:11 PM
To: php-general@lists.php.net
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 <remery@excel.com> 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:thomasedisonjr@yahoo.com]
> 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 <remery@excel.com> 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:thomasedisonjr@yahoo.com]
> > Sent: Tuesday, February 12, 2002 12:02 PM
> > To: php-general@lists.php.net
> > 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 : abraxastech@yahoo.com
> > 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 : abraxastech@yahoo.com
> 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 : abraxastech@yahoo.com
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