• I am attempting to upload 37 records through the import function. The function reports success, 37 records added. However, there are no additional records in the table or that show up on the list participants option. I did not include ID (it is an auto increment thinking I did not need to) or the private_id field. Do I need to include them? Can I just import the data at the database level and make up a private_id value? I did not order the fields in the same order as the blank csv file, is that required?

    https://www.ads-software.com/plugins/participants-database/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter smelliott

    (@smelliott)

    found a little more info on debug:
    WordPress database error Column ‘date_updated’ specified twice for query INSERT INTO

    …[-] Participants_Db::process_form storing record sql=INSERT INTO xx_participants_database SET date_recorded = NOW(), date_updated = NOW(), first_name = %s, last_name = %s, address = %s, city = %s, state = %s, zip = %s, phone = %s, email = %s,……. private_id = %s, date_recorded = %s, date_updated = %s,……

    it looks like you code is listing the date_updated and date_recorded twice in the sql statement…

    Thread Starter smelliott

    (@smelliott)

    I commented out the following to get th import to work. I know this is not a fix, but worked for now.

    case ‘insert’:
    $sql = ‘INSERT INTO ‘ . self::$participants_table . ‘ SET ‘;
    if ( !PDb_Date_Parse::is_mysql_timestamp( @$post[‘date_recorded’] ) )
    // $sql .= ‘ date_recorded = NOW(), ‘; <-commented out
    if ( !PDb_Date_Parse::is_mysql_timestamp( @$post[‘date_updated’] ) )
    // $sql .= ‘ date_updated = NOW(), ‘;<-commented out
    $where = ”;
    break;

    Thread Starter smelliott

    (@smelliott)

    interesting, would only handle 16 records at a time. had to split into two files.

    Plugin Author xnau webdesign

    (@xnau)

    Thanks for all the info, I’ll have a look at this. The alterations you made will prevent new or updated records from being properly timestamped, just so you know.

    What exactly happened when you tried to import more than 16 records?

    I had a similar problem: When importing a CSV file with 39 records the confirmation message looked fine (39 records added), but in the end I got only 13 records in the database.

    It took my while, but the solution was rather simple: The file was not UTF-8 encoded, so any record with a non-ANSI character was not imported.

    I am not sure if smelliott has the same problem, but maybe my contribution is helpful for other users.

    Plugin Author xnau webdesign

    (@xnau)

    Martin, that’s good info…and correct. What I need to do is provide accurate feedback to the user for cases like this.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Import not working’ is closed to new replies.