Title: Where Clause
Last modified: January 29, 2021

---

# Where Clause

 *  [benechin](https://wordpress.org/support/users/benechin/)
 * (@benechin)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/where-clause-2/)
 * Hi Peter
 * I did create two tables
 * 1. Child Data contains ID, Name and Birthdate
    2. Inspection contains Inspection
   Date, Weight, Height and Head circumference
 * I had created user role “Kader” who can input the data for that two tables.
 * Each “Kader” can add, edit and delete child name in Child Data table and add 
   the inspection information in Inspection Table for each Child regularly.
 * I want each “Kader” had their own data n another can’t access it. I have to tried
   to add $$USERID$$ ini WHERE Clause, but it doesn’t work. Each “Kader” can see
   all data. Can you help me? Thanks for your help.

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

 *  Plugin Author [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * (@peterschulznl)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/where-clause-2/#post-13978768)
 * Hi [@benechin](https://wordpress.org/support/users/benechin/),
 * From what I understand from your question, you might need to add an extra condition.
   Can you please have a look at this page:
    [https://wpdataaccess.com/docs/documentation/data-projects/advanced-lookups/](https://wpdataaccess.com/docs/documentation/data-projects/advanced-lookups/)
   See: Static conditional lookups
 * In this example the user capabilities are added to the query. Did you add this
   to your query?
 * Thanks,
    Peter
 *  Thread Starter [benechin](https://wordpress.org/support/users/benechin/)
 * (@benechin)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/where-clause-2/#post-13987659)
 * Thanks for your reply..
 * Its okay now..but i have another problem..why everytime the user add the data
   into table, the username not automatically add to the field, the user must choose
   the username to add, if they not choose, they can’t see the data..thanks
 *  Plugin Author [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * (@peterschulznl)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/where-clause-2/#post-14002013)
 * Hi [@benechin](https://wordpress.org/support/users/benechin/),
 * If you want the plugin to enter the default WP username, edit your Project Template
   and enter $$USER$$ as the default value (or $$USERID$$ if you use the WP user
   id).
 * Hope this helps,
    Peter

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

The topic ‘Where Clause’ 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/)

 * 3 replies
 * 2 participants
 * Last reply from: [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/where-clause-2/#post-14002013)
 * Status: not resolved