• Hi,

    When trying to import CSV file. I’m getting the below error:

    Reading CSV file info...
    
    Validating column mapping...
    
    Enabling buffering...
    
    Reading CSV file...
    
    Connecting to database...
    
    Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Census of the population of the British,93,Digital Census PDF\1816 Population Ce' at line 1
    Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'of the Slave Population of Belize,87,Digital Census PDF\1820 Slave Population Ce' at line 1
    Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Census of,164,Digital Census PDF\1823 Population Cenus.pdf)' at line 1
    Import ready!
    
    3 rows processed
    0 rows inserted
    3 rows with errors
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter ijtzib

    (@ijtzib)

    Hi,

    Here is my Table sql:

    CREATE TABLEincensus`
    ( Census_ID int(11) NOT NULL AUTO_INCREMENT
    , Census_Room int(11) DEFAULT NULL
    , Census_BoxNo int(11) DEFAULT NULL
    , Census_Number varchar(300) COLLATE latin1_general_ci DEFAULT NULL
    , Census_Year varchar(300) COLLATE latin1_general_ci DEFAULT NULL
    , Census_Description varchar(300) COLLATE latin1_general_ci DEFAULT NULL
    , Census_Pages int(11) DEFAULT NULL
    , Census_Link varchar(255) COLLATE latin1_general_ci DEFAULT NULL
    , PRIMARY KEY (Census_ID)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci`

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi @ijtzib,

    It looks like you have a backslash in your CSV: PDF\1823
    A backslash needs to be escaped like this: PDF\\1823

    Does this solve your issue?

    Thanks,
    Peter

    Thread Starter ijtzib

    (@ijtzib)

    Hi @peterschulznl

    Im still getting the error

    THis is how my csv looks like:

    “ID”,”Room”,”BoxNo”,”Number”,”Year”,”Description”,”NoOfPages”,”DocumentLink”
    1,2,1,”Census-2″,1816,”A Census of the population”,93,”Digital Census PDF\\1816 Population Census.pdf”
    2,2,1,”Census-3″,1820,”Census of the Slave”,87,”Digital Census PDF\\1820 Slave Population Census.pdf”
    4,2,1,”Census-4″,1823,”Population Census”,164,”Digital Census PDF\\1823 Population Cenus.pdf”

    …and updated table sql looks like this:

    CREATE TABLEincensus`
    ( Census_ID int(11) NOT NULL AUTO_INCREMENT
    , Census_Room int(11) DEFAULT NULL
    , Census_BoxNo int(11) DEFAULT NULL
    , Census_Number varchar(50) COLLATE latin1_general_ci DEFAULT NULL
    , Census_Year varchar(50) COLLATE latin1_general_ci DEFAULT NULL
    , Census_Description text COLLATE latin1_general_ci
    , Census_Pages int(11) DEFAULT NULL
    , Census_Link text COLLATE latin1_general_ci
    , PRIMARY KEY (Census_ID)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci`

    error looks like this:

    Reading CSV file info...
    
    Validating column mapping...
    
    Enabling buffering...
    
    Reading CSV file...
    
    Connecting to database...
    
    Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Census of the population,93,Digital Census PDF\\1816 Population Census.pdf)' at line 1
    Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'of the Slave,87,Digital Census PDF\\1820 Slave Population Census.pdf)' at line 1
    Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Census,164,Digital Census PDF\\1823 Population Cenus.pdf)' at line 1
    Import ready!
    
    3 rows processed
    0 rows inserted
    3 rows with errors
    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi @ijtzib,

    Can you add the CSV file? You can use the contactform on the plugin website if you prefer to get in touch in private and send it in a reply.

    Thanks,
    Peter

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error CSV Import’ is closed to new replies.