SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Needing Advice!

  1. #1
    SitePoint Zealot marcoBR's Avatar
    Join Date
    Jun 2002
    Location
    Brazil
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Needing Advice, CSV or MySQL?!?!

    My customer's ERP exports CSV files with his products data that I'll use with a CMS, however I'm doubtful what's the best way to extract its data. Should I extract from CSV directly or is better to import it into MySQL then
    extract its data??? What are the advantages and disadvantages of each method???

    If you didn't understand or are needing more details, please let me know.

    Regards,

    marcoBR
    Last edited by marcoBR; Jun 11, 2003 at 18:56.

  2. #2
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What do you want to do with the data?

  3. #3
    SitePoint Zealot marcoBR's Avatar
    Join Date
    Jun 2002
    Location
    Brazil
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Simply display it in the website through templates.

    I'm afraid that importing the data into mysql could be reduntant.

  4. #4
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not necessarily. It would make things a lot quicker in the future if you made a server driven HTML template that connected to MySQL, since MySQL can import CSV files direct.

    The SQL that phpMyAdmin creates to do such a task looks like this:

    Code:
    LOAD DATA LOCAL
    INFILE '/home/tmp/phpN5mpkL'
    INTO TABLE test
    FIELDS TERMINATED BY ',' ENCLOSED BY '\"' ESCAPED BY '\\' LINES TERMINATED BY '\n'
    If you just imported the data monthly, tweaked your code from table name "march" say to table name "april" in your template page and display this month's data.... hope that makes sense.

    G


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
  •