944,076 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Unsolved
  • Views: 5398
  • MySQL RSS
Apr 29th, 2006
0

mysql < CSV < mydql

Expand Post »
What i am trying to do is to extract data from mysql table into a .CSV file and then after editing upload it again to update my DB.

I am planning on using php but i at the time dont know which command will convert mysql table into .CSV and insert/overide the old info in the table from CSV.
Similar Threads
Reputation Points: 10
Solved Threads: 1
Junior Poster
ashneet is offline Offline
147 posts
since Jun 2005
May 8th, 2006
0

Re: mysql < CSV < mydql

from mysql docs under the SELECT syntax:

SELECT a,b,a+b INTO OUTFILE '/tmp/result.txt'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM test_table;

Then you can use the LOAD DATA syntax:

LOAD DATA INFILE 'data.txt' INTO TABLE tbl_name
FIELDS TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\n';

HTH
Reputation Points: 15
Solved Threads: 0
Junior Poster in Training
barnamos is offline Offline
50 posts
since Mar 2005
May 8th, 2006
0

Re: mysql < CSV < mydql

Thanks, That helps
Reputation Points: 10
Solved Threads: 1
Junior Poster
ashneet is offline Offline
147 posts
since Jun 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: Cannot connect to server
Next Thread in MySQL Forum Timeline: URGENT: Implementing search with multiple dissimilar MySQL tables





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC