Title: Query table using current user email
Last modified: January 26, 2022

---

# Query table using current user email

 *  Resolved [alaawahab](https://wordpress.org/support/users/alaawahab/)
 * (@alaawahab)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/query-table-using-current-user-email/)
 * Hi Peter,
    how can I query a table to select record for current user email as
   example Select * from table_name where emp_email= %current_user_email%

Viewing 1 replies (of 1 total)

 *  Plugin Author [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * (@peterschulznl)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/query-table-using-current-user-email/#post-15292593)
 * Hi Alaa,
 * You can use the $$EMAIL$$ environment variable in your where clause. But this
   works in the Data Publisher and Data Projects only. This is not possible in a
   SQL query since the database is not aware of your WordPress user account, as 
   WordPress uses the same connection (and credentials) for all SQL queries.
 * Using this in the Data Publisher is explained here:
    [https://wpdataaccess.com/docs/documentation/data-publisher/adding-filters/](https://wpdataaccess.com/docs/documentation/data-publisher/adding-filters/)
 * Using this in the Data Projects is explained here:
    [https://wpdataaccess.com/docs/documentation/data-projects/adding-filters/](https://wpdataaccess.com/docs/documentation/data-projects/adding-filters/)
 * Does this help for your use case?
 * Best regards,
    Peter

Viewing 1 replies (of 1 total)

The topic ‘Query table using current user email’ 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/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/query-table-using-current-user-email/#post-15292593)
 * Status: resolved