SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2004
    Location
    www.zenfour.com
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    uploading to mysql using CSV

    is there a script to do this?

    for example, i have an outlook express export (spearated by comma values)

    and i need the names and emails only plugged into a mysql db. Can anyone help? if you want i can post a link to the export and show the db fields

  2. #2
    Non-Member
    Join Date
    Nov 2002
    Location
    Earth
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use the LOAD DATA IN FILE command.

  3. #3
    SitePoint Zealot
    Join Date
    Jan 2004
    Location
    www.zenfour.com
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    come again? sorry I am more of a web designer, not a programmer

  4. #4
    Non-Member
    Join Date
    Nov 2002
    Location
    Earth
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's in the mysql docs.

  5. #5
    SitePoint Wizard Lats's Avatar
    Join Date
    Jun 2003
    Location
    Melbourne, AU
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Another option would be to load your CSV data into Excel, delete the columns that aren't required, save again as CSV and then import into your database via phpmyadmin.
    Lats...

  6. #6
    SitePoint Member
    Join Date
    Apr 2004
    Location
    Buffalo
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    old post regarding csv to php to mysql

    Lats
    This is an old post but you offered advice on uploading CSV via phpmyadmin to mysql.
    Quote Originally Posted by Lats
    Another option would be to load your CSV data into Excel, delete the columns that aren't required, save again as CSV and then import into your database via phpmyadmin.
    I hope you can offer some advice.
    Here is what is happening:
    I save an Excel file (I have the first column empty before I save it to allow for auto-increment) as .csv. Once I go through the various dialog boxes, saving the file, I add a "1" in the first column, first row so phpmyadmin will "see" the column. I then upload the csv.THe first file of 127 records uploads perfectly. However, the second will not upload at all. What do I need to do to add on to the existing file. (I used 128 as the first row, column because it is the primary key id column.)
    I am learning this stuff so if you need more info, let me know
    Thank you for any help bufhal

  7. #7
    SitePoint Wizard Lats's Avatar
    Join Date
    Jun 2003
    Location
    Melbourne, AU
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bufhal
    ...the second will not upload at all.
    You may want to check the field type used for the key - it sounds like you may be using tinyint? If so, try using int.
    Lats...


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
  •