• Hi. I’m having an issue importing my csv file. It worked fine yesterday, no edits made, and now I get this…..

    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 ‘WHERE id = 245699’ at line 1

    The first line of data is imported and the remaining ignored.

    debugging log:

    [09/25/23 4:16am UTC]PDb_submission\main_query\base_query::execute_query storing record: INSERT INTO wpkv_participants_database SET date_recorded = “2023-09-25 04:16:55”, date_updated = “2023-09-25 04:16:55”, list_surname = ‘Japp’, list_first_names = ‘Elizabeth Stewart Hynd’, from_date = ‘Birth’, event_date = ‘1/04/1905’, place = ‘Kelty, Fife, Scotland’, first_name = ‘Xxx’, last_name = ‘Xxxxxxxx’, email = ‘[email protected]’, approved = ‘no’, private_id = ‘2B3L116’

    [09/25/23 4:16am UTC]PDb_submission\main_query\base_query::execute_query record store 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 ‘WHERE id = 245699’ at line 1 for query: UPDATE wpkv_participants_database SET WHERE id = 245699

    Any clues to point me in the right direction and get this resolved.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author xnau webdesign

    (@xnau)

    First place to start with an issue like this is the CSV file. If the file can sucessfully import records, but throws an error on a particular record, you can open the CSV file in a plain text editor, and find that record. Each record in a CSV file is a line, which is delineated by a line return.

    The error log is unclear about what is going on, maybe it is incomplete? The first entry looks truncated.

    Anyway, most of the time, the problem is a flaw in the CSV file, and sometimes it takes some close observation to find it.

    Thread Starter SueL

    (@suel)

    Thank you. Appreciate the quick response.

    Here’s the first 2 rows of my csv…….

    list_surname,list_first_names,from_date,event_date,place,married_first_name,married_surname,first_name,last_name,email,id
    Japp,Elizabeth Stewart Hynd,Birth,1/04/1905,”Kelty, Fife, Scotland”,,,Xxx,Xxxxxxxxx,[email protected],

    The last column (id) is always blank.

    Does anything look out of place/incorrect?

    Plugin Author xnau webdesign

    (@xnau)

    Were there any messages printed to the screen when you performed the import? This will usually tell you where to look for the problem.

    What you posted there looks OK, but that’s probably not where the problem is.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘CSV Import error’ is closed to new replies.