4 Replies Latest reply on Jan 26, 2007 11:36 AM by Dan Bracuk

    Help with MySQL

    Woody1980
      Hey Guys,

      I am currently in the process of developing a website for a client. What my client would like to do is take their clients information from a database that they have in their offices and use that information on their website. They have the ability to export that information to a couple of different file types. What I have played around with so far is a tab delimited text file. I have written a ColdFusion (MX7) page using <cffile action="read"> which gets the text file. How do I then "parse" (is that the right term?) that data and insert it into my database?

      Thank you in advance for your help!
        • 1. Re: Help with MySQL
          Level 7
          You can output a CSV doc and then use cfhttp to grab it and turn it into a
          query and loop it into the table

          "Woody1980" <webforumsuser@macromedia.com> wrote in message
          news:epdb3o$o4d$1@forums.macromedia.com...
          > Hey Guys,
          >
          > I am currently in the process of developing a website for a client. What
          > my
          > client would like to do is take their clients information from a database
          > that
          > they have in their offices and use that information on their website. They
          > have
          > the ability to export that information to a couple of different file
          > types.
          > What I have played around with so far is a tab delimited text file. I have
          > written a ColdFusion (MX7) page using <cffile action="read"> which gets
          > the
          > text file. How do I then "parse" (is that the right term?) that data and
          > insert
          > it into my database?
          >
          > Thank you in advance for your help!
          >


          • 2. Re: Help with MySQL
            Dan Bracuk Level 5
            Tab is probably a better delimiter than comma, because comma is more likely to occur in the data. You can use cfhttp to convert any delimited file to a query, not just csv files.
            • 3. Re: Help with MySQL
              Woody1980 Level 1
              Hey Guys,

              Thank you very much for replying so quickly. Can you please look at the attached code to see if I am on target here? When my client exported the tab delimited file he included the headers. Will this new query recognize those headers as variables that I can output? Such as #Account#? What I am getting now is a http 500 error when I try to test it. (By the way I am using CFMX7 Developer)

              Thanks for you help guys. I only began programming with coldfusion about 6 months ago and I have come pretty far. But when it comes to this I am hitting a road block.

              • 4. Re: Help with MySQL
                Dan Bracuk Level 5
                I've only done it a couple of times at most. The approach was to use cffile to upload and read the file, and cfhttp to turn it into a query.