Have a look at mysqlimport. This prog will import data from a flatfile into a named table. Also check the LOAD DATA INFILE command that may be of some help.
What may be bogging you is the delimiters in the text file. 1. Check that every field is separated by a comma/space/tab - though comma is better (You can create an 'export file' directly from excel by saving as csv) 2. Check that every field is enclosed in a pair of doublequotes - recommended. What you NEED to verify at this stage is that NO field contains a double quote itself as this would mean the end of the field and throw the whole thing up. If you ever have double quotes in you field, escape each double quote by \ - ex. "link 1", "<a href="http://www.link1.com">", "this is a useful link" -- would become -- "link1", "<a href=\"http://www.link1.com\">", "this is a useful link" Then, in at the MySQL prompt run LOAD DATA INFILE 'myfile.txt' INTO table_name FIELDS TERMINATED BY , ENCLOSED BY " ESCAPED BY \\ LINES TERMINATING BY \n Note that this assumes that myfile.txt is found in the database folder. You could also specify the whole path. For more information on 'LOAD DATA INFILE' check section 6.4.8 of the MySQL Manual Paul | -----Original Message----- | From: Joseph, Smile Poet [mailto:[EMAIL PROTECTED] | Sent: Sunday, January 11, 2004 8:07 AM | To: [EMAIL PROTECTED] | Subject: [wdvltalk] Re: entering data in MySql | | | Bj, | | Easy is a ready-made combination of all the elements (php, MySql, | Apache and whatever else goes into this particular pot). It | installs very easily, but the documentation is a development or two | behind and very dense. As I know no coding (having just tickled at | it 20 years ago) I couldn't make out why I was failing to | enter the data as all else seemed to have worked. | | I suspect I have a change to make in a config file (as David has | guided me towards) and I'll follow up on that next. My 56 modem | demands a local server for development; should my broadband day come | and I crashed another server I should think it would send me | to hide in a cave for years ;-). | | I have found the tutorials difficult because they are largely aimed at | those with some knowledge though I have learned a bit from them. I | now have a couple of tutorials which look about my level. Looking | forward to working on them. | | Joseph | > ----- Original Message ----- | > From: "Joseph, Smile Poet" | > | > > I have spent five hours that I hoped would send me | > > far up the learning curve trying to solve this. Has | > > anyone a suggestion of where I might look for the | > > answer. | > | > Start again properly? I have no idea what "EasyPHP" is about except | that I | > bet it ain't easy. I am running the Microsoft Personal Web Server | that | > comes on the Win98 CD as a local Web server for development/testing, | along | > with php which I got from PHP itself (www.php.net 'downloads' ), | which was | > pretty easy to install and run, and the mySQL I got from mySQL | > (www.mysql.com) | > | > I think there's a distribution some others here use where you get | Apache, | > mySQL and php all in one? | > | > Of course having a local Web server is a bit less of an issue since | I got | > cable, as I can do devlopment and testing on the live site just | about as | > quickly as locally... although code errors that crash the server are | just a | > *little* more embarassing :o) | | | | ____ . The WDVL Discussion List from WDVL.COM . ____ | To Join wdvltalk, Send An Email To: | mailto:[EMAIL PROTECTED] | Send Your Posts | To: [EMAIL PROTECTED] | To set a personal password send an email to | [EMAIL PROTECTED] with the words: "set WDVLTALK | pw=yourpassword" in the body of the email. To change | subscription settings to the wdvltalk digest version: | http://wdvl.internet.com/WDVL/Forum/#sub | | ________________ http://www.wdvl.com _______________________ | | You are currently subscribed to wdvltalk as: | [EMAIL PROTECTED] To unsubscribe send a blank email to | %%email.unsub%% | | To unsubscribe via postal mail, please contact us at: | Jupitermedia Corp. | Attn: Discussion List Management | 475 Park Avenue South | New York, NY 10016 | | Please include the email address which you have been contacted with. | | | ____ � The WDVL Discussion List from WDVL.COM � ____ To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] Send Your Posts To: [EMAIL PROTECTED] To set a personal password send an email to [EMAIL PROTECTED] with the words: "set WDVLTALK pw=yourpassword" in the body of the email. To change subscription settings to the wdvltalk digest version: http://wdvl.internet.com/WDVL/Forum/#sub ________________ http://www.wdvl.com _______________________ You are currently subscribed to wdvltalk as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] To unsubscribe via postal mail, please contact us at: Jupitermedia Corp. Attn: Discussion List Management 475 Park Avenue South New York, NY 10016 Please include the email address which you have been contacted with.
