Title: Warning: creating default object db-class.php
Last modified: June 7, 2019

---

# Warning: creating default object db-class.php

 *  Resolved [fbrusis](https://wordpress.org/support/users/fbrusis/)
 * (@fbrusis)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/warning-creating-default-object-db-class-php/)
 * Hi,
    after installing I got warning on creating default object in db-class.php.
   Login to my wp-backend was not possible any more. I fixed it myself in this way.
 * Error:
    Warning: Creating default object from empty value in ../plugins/final-
   tiles-grid-gallery-lite/lib/db-class.php on line 152
 * Warning: Cannot modify header information – headers already sent by (output started
   at ../plugins/final-tiles-grid-gallery-lite/lib/db-class.php:152) in ../wp-admin/
   includes/misc.php on line 1196
 * Fix: add line 152: if(isset($data->Id))
 * Modified function getGalleries():
    public function getGalleries() { global $wpdb;
   $tb_g = $wpdb->prefix . “FinalTiles_gallery”; $tb_i = $wpdb->prefix . “FinalTiles_gallery_images”;
 *  $query = “SELECT Id, configuration FROM $tb_g order by id”;
    $galleryResults
   = $wpdb->get_results( $query );
 *  $result = array();
    foreach($galleryResults as $gallery) { $data = json_decode(
   $gallery->configuration); if(isset($data->Id)) /* new added by myself */ $data-
   >Id = $gallery->Id; $result[] = $data; } return $result; }

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

 *  [Diego](https://wordpress.org/support/users/greentreelabs/)
 * (@greentreelabs)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/warning-creating-default-object-db-class-php/#post-11615591)
 * Hi, thanks for reporting the issue. Usually that error means you’re trying to
   load a gallery that doesn’t exist, I’ll probably add a specific error message.
 * Cheers,
    Diego
 *  [aardwark69](https://wordpress.org/support/users/aardwark69/)
 * (@aardwark69)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/warning-creating-default-object-db-class-php/#post-11821773)
 * Well, I am getting the same error:
 * Warning: Creating default object from empty value in /wp-content/plugins/final-
   tiles-grid-gallery-lite/lib/gallery-class.php on line 835
 * here:[http://czarnecki.study/index.php/personal/scuba-diving-underwater-photography/key-largo-reefs-caribbean-sea-2007/](http://czarnecki.study/index.php/personal/scuba-diving-underwater-photography/key-largo-reefs-caribbean-sea-2007/)
 * gallery does exist, i tried changing the name, copying it… and i keep getting
   the same message
 *  [Diego](https://wordpress.org/support/users/greentreelabs/)
 * (@greentreelabs)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/warning-creating-default-object-db-class-php/#post-11831123)
 * Hi [@aardwark69](https://wordpress.org/support/users/aardwark69/) I checked the
   page but it doesn’t exist.

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

The topic ‘Warning: creating default object db-class.php’ is closed to new replies.

 * ![](https://ps.w.org/final-tiles-grid-gallery-lite/assets/icon.svg?rev=3184352)
 * [Image Photo Gallery Final Tiles Grid](https://wordpress.org/plugins/final-tiles-grid-gallery-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/final-tiles-grid-gallery-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/final-tiles-grid-gallery-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/final-tiles-grid-gallery-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/final-tiles-grid-gallery-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/final-tiles-grid-gallery-lite/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Diego](https://wordpress.org/support/users/greentreelabs/)
 * Last activity: [6 years, 8 months ago](https://wordpress.org/support/topic/warning-creating-default-object-db-class-php/#post-11831123)
 * Status: resolved