Title: Database error while zip upload
Last modified: August 20, 2016

---

# Database error while zip upload

 *  [Data1992](https://wordpress.org/support/users/data1992/)
 * (@data1992)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/database-error-while-zip-upload/)
 * Hey guys,
    I hope you can help me. Today, I’ve installed a fresh version of WordPress
   on my webspace. After that I’ve downloaded the latest NextGEN plugin version 
   1.8.1 and installed this as well. Everything fine for now. But when I try to 
   upload a zip file I get a database error which tells me that the upload was successful
   but that no new record for the new gallery could be added into the database table.
   I’ve searched through the source code a little bit and found that the error was
   thrown by a missing “slug” string in the sql statement in _admin/functions.php
   on line 172_
 *     ```
       if (!$gallery_id) {
         $result = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->nggallery (name, path, title, author) VALUES (%s, %s, %s, %s)", $galleryname, $galleryfolder, $galleryname , $user_ID) );
         if (!$result) {
           nggGallery::show_error(__('Database error. Could not add gallery!','nggallery'));
           return;
         }
         $created_msg = _n( 'Gallery', 'Galleries', 1, 'nggallery' ) . ' <strong>' . $galleryname . '</strong> ' . __('successfully created!','nggallery') . '<br />';
         $gallery_id  = $wpdb->insert_id;  // get index_id
       }
       ```
   
 * Is there a “trick” to avoid this error message or how can it be fixed otherwise?
 * Greetings
    Marc

The topic ‘Database error while zip upload’ is closed to new replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

## Tags

 * [upload](https://wordpress.org/support/topic-tag/upload/)
 * [zip](https://wordpress.org/support/topic-tag/zip/)

 * 0 replies
 * 1 participant
 * Last reply from: [Data1992](https://wordpress.org/support/users/data1992/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/database-error-while-zip-upload/)
 * Status: not resolved