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…
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;
interesting, would only handle 16 records at a time. had to split into two files.
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.
Martin, that’s good info…and correct. What I need to do is provide accurate feedback to the user for cases like this.