uploading .csv by phpmyadmin

Discussion in 'Databases' started by mnymkr, Jul 14, 2007.

  1. #1
    I am having a bit of trouble here.

    I need to upload a .csv into may database and I keep getting errors

    I mean this is a plain jane .csv

    my fields are not enclosed by anything yet it keeps wanting something there.

    Shape,Carat,Color,Clarity,Cert,Depth,Table,Girdle,Culet,Polish,Sym,Fluor,Meas,Comment,Image,, Make,Date,City,State,Country,,Lot #,Owner,Price,%/Rap,Cert #,Stock #
    B,1.46,D,SI2,EGL,62.2,55,STK-,N,VG,EX,N,7.23x7.28x4.51,EXCELLENT IDEAL CUT,,,,5/14/2007 14:17,NEW YORK,NY,USA,,11890768,1001dj,3540,-0.4,,1862
    E,1.2,H,VS2,GIA,64.2,65,M-,N,VG,VG,N,7.95x5.03x3.23,,,,,5/14/2007 14:17,NEW YORK,NY,USA,,11890770,1001dj,3250,-0.35,,1857
    B,0.9,G,SI1,EGL,62.4,56,STK-,N,VG,VG,,6.04x6.12x3.80,TOLKOWSKY IDEAL CUT,,,,5/14/2007 14:17,NEW YORK,NY,USA,,11838062,1001dj,2808,-0.46,,1854
    
    Code (markup):
    Here are my frist two rows of my csv

    what do i need to enter into my import function to get this to work

    I have already entered all the columns names......is this correct?

    thanks
     
    mnymkr, Jul 14, 2007 IP
  2. gibex

    gibex Active Member

    Messages:
    1,060
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    95
    #2
    to put single or double quotes around your data before you insert them.
     
    gibex, Jul 15, 2007 IP
  3. mnymkr

    mnymkr Well-Known Member

    Messages:
    2,328
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    120
    #3
    that worked great thanks!

    keep getting an error half way through that says something about not valid csv but it is....wierd
     
    mnymkr, Jul 15, 2007 IP
  4. gibex

    gibex Active Member

    Messages:
    1,060
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    95
    #4
    ok, it's possible to have also ' between two commas, so:
    ,some ' text, you should make it like this: ,'some\'text', -> escape also ' from text.
     
    gibex, Jul 16, 2007 IP