SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Dec 2005
    Posts
    381
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question php txt parser to upload data to MYSQL DB

    Hi

    I'm having a few problems with getting data from a .txt file input into my MySQL database using a php script.
    Basically what I have is a text file which in essence contains a stocklist that will be updated regularly. The txt file is going to be sitting on our web server.
    I've attached a sample of one of the text files to this post. There will be alot more data than this in the actual files.

    What I need is a script that I can run which will take the contents of this text file and update my MySQL database. I need the script to truncate the table initially and then insert all the data correctly in the table.

    I've been told that I will probably need to write a parser to do this but i don't know how to go about building one.

    If anyone can help me with this it'd be very much appreciated. I'm starting to run out of time on this one!

    Thanks for any help in advance
    Attached Files Attached Files

  2. #2
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you looking for someone to write the script? Consider "looking to hire" forum.

  3. #3
    SitePoint Addict
    Join Date
    Dec 2005
    Posts
    381
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a script which isn't working correctly.
    It does import the data to my database but ignores the double quote marks and therefore uploads the data incorrectly.
    I can attach this script if you think you could have a look and see what I'm doing wrong with it?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •