If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > UPDATE SET question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-03-04, 06:13
zapdafish zapdafish is offline
Registered User
 
Join Date: Jul 2004
Posts: 1
Thumbs down UPDATE SET question

Hi,

I have a table with a text field, when using

UPDATE database_name SET col_name=whatever;

how do I load a local text file in place of whatever?



Thnx...Steve
Reply With Quote
  #2 (permalink)  
Old 07-03-04, 18:38
yellowmarker yellowmarker is offline
Registered User
 
Join Date: Jul 2004
Location: Dundee, Scotland
Posts: 107
sounds like you need to read the csv file contents via a web page then insert into mysql.

In the past I have used: @fgetcsv($fp, 1024, ",");

that reads each line from the csv file into an array which acn be iterated through. MySQL insert queries then can be built and executed.

alternatively a quick google search find this:
http://www.codenewbie.com/forum/t2047.html

Let me know if I've missed the point or if you'd like a further code sample.

Matthew McNicol
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On