Title: Database warning error
Last modified: November 30, 2019

---

# Database warning error

 *  Resolved [gaupoit](https://wordpress.org/support/users/gaupoit/)
 * (@gaupoit)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/database-warning-error/)
 * Hello there,
 * I am developing the WordPress plugins which following this guide [https://codex.wordpress.org/Creating_Tables_with_Plugins](https://codex.wordpress.org/Creating_Tables_with_Plugins)
   to create the custom table for my plugin. In this guide, it’s using the function
   dbDelta which having this line:
 * `$tablefields = $wpdb->get_results( "DESCRIBE {$table};" );`
 * This code must show the database ERROR due to our custom table doesn’t exist.
   It’s easy to see that by using Query Monitor plugin ([https://wordpress.org/plugins/query-monitor/](https://wordpress.org/plugins/query-monitor/)).
 * Is there any better way to create table without the ERROR message?

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

 *  [anant101289](https://wordpress.org/support/users/anant101289/)
 * (@anant101289)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/database-warning-error/#post-12191378)
 * Hello [@gaupoit](https://wordpress.org/support/users/gaupoit/),
 * please check below files to understand of function.
 * `wp-admin/includes/schema.php`
 * `wp-admin/includes/upgrade.php`
 * Thanks
    -  This reply was modified 6 years, 5 months ago by [anant101289](https://wordpress.org/support/users/anant101289/).
 *  Thread Starter [gaupoit](https://wordpress.org/support/users/gaupoit/)
 * (@gaupoit)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/database-warning-error/#post-12192901)
 * Thanks for your hints [@anant101289](https://wordpress.org/support/users/anant101289/),
   I found the ticket here [https://core.trac.wordpress.org/ticket/40694#no0](https://core.trac.wordpress.org/ticket/40694#no0)
   that explains exactly what’s going on in dbDelta.
 * > In dbDelta, $tablefields is populated by the statement DESCRIBE {$table}. When
   > the table does not exist, this statement fails with an error. This statement
   > is executed with error suppression enabled.
 * Query Monitor plugin will collect and show this errors.

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

The topic ‘Database warning error’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [gaupoit](https://wordpress.org/support/users/gaupoit/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/database-warning-error/#post-12192901)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
