phpbeginner Posted October 12, 2007 Share Posted October 12, 2007 I have a client who I am building a newsletter for and have a database built for the e-mail addresses, etc..The table has 4 fields (id,address,validate,nlid). The client sent me a loooonnnngggg list of addresses on notepad only seperated by a line break. Is there an easy way to take this notepad file and insert the addresses into the table where column=address ? Thanks in Advance P.S.- there are 4 lists so for each list I insert the id is auto increment, address is from the lists, validate will = 1 and nlid will be 1,2,3, or 4 depending on the list I am inserting. Quote Link to comment https://forums.phpfreaks.com/topic/72910-importing-data-for-field-from-text-file/ Share on other sites More sharing options...
fenway Posted October 12, 2007 Share Posted October 12, 2007 Sure... use LOAD DATA LOCAL INFILE and just parse it, you can set the other column on the fly. Quote Link to comment https://forums.phpfreaks.com/topic/72910-importing-data-for-field-from-text-file/#findComment-367828 Share on other sites More sharing options...
phpbeginner Posted October 13, 2007 Author Share Posted October 13, 2007 Never done this before .....how do I go about setting the other columns on the fly ? I have looked it up (LOAD DATA LOCAL INFILE) but don't seem to be having any luck with it. Quote Link to comment https://forums.phpfreaks.com/topic/72910-importing-data-for-field-from-text-file/#findComment-368675 Share on other sites More sharing options...
fenway Posted October 15, 2007 Share Posted October 15, 2007 Never done this before .....how do I go about setting the other columns on the fly ? I have looked it up (LOAD DATA LOCAL INFILE) but don't seem to be having any luck with it. With which part? The refman page is quite detailed. Quote Link to comment https://forums.phpfreaks.com/topic/72910-importing-data-for-field-from-text-file/#findComment-369852 Share on other sites More sharing options...
phpbeginner Posted October 15, 2007 Author Share Posted October 15, 2007 That's what I was reading on and where I went originally. I can't get any of my data to load. Even if I could get the addresses to load would be a plus. Quote Link to comment https://forums.phpfreaks.com/topic/72910-importing-data-for-field-from-text-file/#findComment-369896 Share on other sites More sharing options...
fenway Posted October 15, 2007 Share Posted October 15, 2007 I can't get any of my data to load. Why not? What happens? What statement did you try to run? Quote Link to comment https://forums.phpfreaks.com/topic/72910-importing-data-for-field-from-text-file/#findComment-369994 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.