Title: WordPress database error after fresh install
Last modified: August 21, 2016

---

# WordPress database error after fresh install

 *  Resolved [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-after-fresh-install/)
 * I just downloaded and activated your version 1.0.0.
 * I added the shortcode `[ewz_show_webform identifier="pair"]` to a page and tried
   to upload a new image. When I clicked the Submit button I got a dialog box that
   said (in part) “WordPress database error [Field last_change doesn’t have a default
   value]” and “Sorry, there was a problem creating the item …”
 * I made a change to the `save()` function in ewz-item.php that avoids the error:
 *     ```
       } else {
       //                $data['upload_date'] = current_time( 'mysql' );
       //                array_push( $datatypes, '%s' );
                       $data['last_change'] = $data['upload_date'] = current_time( 'mysql' );
                       array_push( $datatypes, '%s' );
                       array_push( $datatypes, '%s' );
   
                       $wpdb->insert( EWZ_ITEM_TABLE, $data, $datatypes );
                       $inserted = $wpdb->insert_id;
                       if ( !$inserted ) {
                           foreach( $this->item_files as $item_file ){
                               $errors .= $this->delete_file( $item_file );
                           }
                           throw new EWZ_Exception( 'Sorry, there was a problem creating the item '. basename( $item_file['fname'] ) .
                                                    ", please refresh the page to see your current status.\n", $errors );
                       }
                   }
       ```
   
 * As you can see, I commented out two original lines and added some code to supply
   a value for ‘last_change’.
 * I also had a problem with the “Example Competition Form”. I selected “Digital”,
   supplied a title and clicked “Submit”. I got a dialog box that said “Sorry, there
   was an error in row 1: A Digital type must have an Image File.” There is no visible
   field on the form where I can supply an image file.
 * [http://wordpress.org/plugins/entrywizard/](http://wordpress.org/plugins/entrywizard/)

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

 *  Plugin Author [Ilia Tyker](https://wordpress.org/support/users/joanne123/)
 * (@joanne123)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-after-fresh-install/#post-4546604)
 * Thanks, and apologies – there seem to be some issues with the latest versions
   of WordPress and MySql. I’ll get changes out ASAP.
 *  Plugin Author [Ilia Tyker](https://wordpress.org/support/users/joanne123/)
 * (@joanne123)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-after-fresh-install/#post-4546688)
 * I’ve uploaded a new version. Please let me know if that fixes the issue for you.
 *  Thread Starter [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-after-fresh-install/#post-4546713)
 * Josie,
 * Thanks for the quick action and this update. I am traveling in Guatemala until
   February 10, but I will give this a try when I return home.
 *  Thread Starter [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/wordpress-database-error-after-fresh-install/#post-4546761)
 * Josie,
 * I finally had a chance to test the new version; thanks for your patience.
 * First, I simply updated from v1.0.0 to v1.0.1. This didn’t go so well. The “Image
   Pair Layout” Fields list was empty, and my attempt to copy the layout to a new
   layout failed with PHP notices and an error message about no fields begin defined.
   The “front end” display generated by the `ewz_show_webform` shortcode also had
   problems, e.g., only one image was displayed.
 * Second, I deactivated and deleted the plugin, then installed a fresh copy of 
   v1.0.1. That worked fine. I was able to use both the Image Pair Form and Example
   Competition Form without any errors.
 * In summary, a fresh install worked fine, but a version upgrade had problems. 
   I am satisfied with the resolution of this issue, because deleting and re-installing
   worked.

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

The topic ‘WordPress database error after fresh install’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/entrywizard.svg)
 * [EntryWizard](https://wordpress.org/plugins/entrywizard/)
 * [Support Threads](https://wordpress.org/support/plugin/entrywizard/)
 * [Active Topics](https://wordpress.org/support/plugin/entrywizard/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/entrywizard/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/entrywizard/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [David Lingren](https://wordpress.org/support/users/dglingren/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/wordpress-database-error-after-fresh-install/#post-4546761)
 * Status: resolved