Title: Bug: DB Error &#8211; Table wp_users does not exist
Last modified: September 30, 2016

---

# Bug: DB Error – Table wp_users does not exist

 *  [Gahapati](https://wordpress.org/support/users/gahapati/)
 * (@gahapati)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/bug-db-error-table-wp_users-does-not-exist/)
 * Thank you, Bastien, for providing this plugin.
    I find it quite useful, but unfortunately
   there are issues that keep me from actually using it.
 * The main issue I have is a consistent database error.
 * I hope I can help pointing you in the right direction, so that you may be able
   to fix it.
 * Since I first tried _My shared widgets_ with WP 4.3.x, I have consistently had
   a DB error which did not change after updating to WP 4.4.x.
 * The error message originally read:
 * > WordPress Database Error Table ‘wp_users’ doesn’t exist for query SELECT ‘user_nicename’
   > FROM wp_users WHERE ID =
 * The error is in the prefix of the table name _wp\_users_, which should read _**
   dp\_**users_.
 * When I looked at the code, I found that _wp\_users_ is hard-coded.
    I changed
   your line of code `$a_req = 'SELECT ´user_nicename´ FROM wp_users WHERE ID = '.
   $widget->post_author;` to read:
 *     ```
       $usr_nice = $wpdb->base_prefix . 'users';
       $a_req = 'SELECT ´user_nicename´  FROM ' . $usr_nice . ' WHERE ID = ' . $widget->post_author;
       ```
   
 * This had the nice effect that the original DB error was gone, but a new one showed
   up:
 * > You have an error in your SQL syntax for the query SELECT ‘user_nicename’ FROM
   > dp_users WHERE ID =
 * I checked the syntax in phpMyAdmin and found that the _ SQL syntax itself_ is
   ok, but _$widget->post\_author_ turns out empty.
 * This is where I got stuck. I hope you can find the error from here on, for I 
   was not able to trace it back any further.
 * I’d appreciate any help you can give.
    -  This topic was modified 9 years, 8 months ago by [Gahapati](https://wordpress.org/support/users/gahapati/).
      Reason: Tried to correct formating

The topic ‘Bug: DB Error – Table wp_users does not exist’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/eelv-my-widgets_cab0ce.svg)
 * [My shared widgets](https://wordpress.org/plugins/eelv-my-widgets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/eelv-my-widgets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/eelv-my-widgets/)
 * [Active Topics](https://wordpress.org/support/plugin/eelv-my-widgets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/eelv-my-widgets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/eelv-my-widgets/reviews/)

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [Gahapati](https://wordpress.org/support/users/gahapati/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/bug-db-error-table-wp_users-does-not-exist/)
 * Status: not resolved