Title: Currently LoggedIn User code
Last modified: April 22, 2025

---

# Currently LoggedIn User code

 *  Resolved [wp help](https://wordpress.org/support/users/platinumrealty/)
 * (@platinumrealty)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/currently-loggedin-user-code/)
 * Hello,
 * Please simply tell us where and what code to enter to get ONLY results that are
   attached to the logged-in user to display on the frontend.
 * We have created a data table using App Builder, have placed the shortcode on 
   the frontend, yet it is displaying all entries for every user.
 * Simply advise of WHERE within the app builder table and WHAT CODE we need to 
   use to accomplish this.
 * Thank you
 * Regards,

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

 *  Plugin Contributor [Kim L](https://wordpress.org/support/users/kimmyx/)
 * (@kimmyx)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/currently-loggedin-user-code/#post-18430669)
 * Hi [@platinumrealty](https://wordpress.org/support/users/platinumrealty/),
 * You may add the following to your **Default Where** field in the table builder:
 *     ```wp-block-code
       UserID = @wpda_wp_user_id
       ```
   
 * Change `UserID` to any column name that directly reflects the user’s ID generated
   by WordPress.
 * For more information, please see:
    - [Environment variables | WP Data Access](https://wpdataaccess.com/docs/variable/environment-variables/)
    - [WordPress user ID in SQL | WP Data Access](https://wpdataaccess.com/docs/variable/wordpress-user-id-in-sql/)
 * Hope this helps!
    -  This reply was modified 1 year, 1 month ago by [Kim L](https://wordpress.org/support/users/kimmyx/).
      Reason: added links
 *  Thread Starter [wp help](https://wordpress.org/support/users/platinumrealty/)
 * (@platinumrealty)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/currently-loggedin-user-code/#post-18430861)
 * Thank you
 * We get this error – unknown column ‘UserID’ in where clause.
 * Without having to amend the table to add UserID column, how do we connect to 
   other tables that do have a UserID column?
 * Please advise.

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

The topic ‘Currently LoggedIn User code’ is closed to new replies.

 * ![](https://ps.w.org/wp-data-access/assets/icon-256x256.png?rev=3299063)
 * [WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards](https://wordpress.org/plugins/wp-data-access/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-data-access/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-data-access/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-data-access/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-data-access/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [wp help](https://wordpress.org/support/users/platinumrealty/)
 * Last activity: [1 year, 1 month ago](https://wordpress.org/support/topic/currently-loggedin-user-code/#post-18430861)
 * Status: resolved