Title: Database Relations
Last modified: October 31, 2022

---

# Database Relations

 *  Resolved [recepbala](https://wordpress.org/support/users/recepbala/)
 * (@recepbala)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/database-relations/)
 * i could not figure out how to do this with WPDataAccess 🙁
 * 3 tables -> customers, services, services_providers
    1 table -> to bind them 
   all when a service is sold
 * while looking at customers table, i should be able to sell a service from a service
   provider. it would be nice to even filter service providers by the chosen service
   🙂
 * hope i dont need premium for this 🙂
    -  This topic was modified 3 years, 7 months ago by [recepbala](https://wordpress.org/support/users/recepbala/).
    -  This topic was modified 3 years, 7 months ago by [recepbala](https://wordpress.org/support/users/recepbala/).

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

 *  Plugin Contributor [Kim L](https://wordpress.org/support/users/kimmyx/)
 * (@kimmyx)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/database-relations/#post-16152724)
 * Hi [@recepbala](https://wordpress.org/support/users/recepbala/),
 * Can you give us more details about what you want to achieve?
 * Is this a front-end table display or a full-blown data project? 🙂
 * We look forward to your response.
 *  Thread Starter [recepbala](https://wordpress.org/support/users/recepbala/)
 * (@recepbala)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/database-relations/#post-16152799)
 * we may say data project for a small company 🙂
    tring to keep track of things
   going on in the company
 *  Plugin Author [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * (@peterschulznl)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/database-relations/#post-16155188)
 * Hi [@recepbala](https://wordpress.org/support/users/recepbala/),
 * What do you mean with:
    3 tables -> customers, services, services_providers 1
   table -> **to bind them all when a service is sold**
 * Is this a view joining the other tables? Or a master detail page? Or something
   else?
 * If you want to join multiple tables, you can just create a view from your custom
   query and use that view instead of a table in your project or publication. Master
   detail pages can be created with Data Projects where each detail table can be
   show in a seperate tab. Here is the documentation:
    [https://wpdataaccess.com/docs/data-projects/one-to-many-relationships/](https://wpdataaccess.com/docs/data-projects/one-to-many-relationships/)
 * A premium license is not needed for these features, but adding dynamic filters
   might. It depends on your requirements. Is this a reporting page or data management?
   In other words: is the user changing data or only viewing?
 * Thanks,
    Peter
 *  Thread Starter [recepbala](https://wordpress.org/support/users/recepbala/)
 * (@recepbala)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/database-relations/#post-16164195)
 * all start with customer table.
    and i got another table showing what is/are serviced
   to each customers. parent/child working perfectly.
 * the thing is that this child table got another relations also.
    when i add a 
   record, i need service_name from another table related through service_id. i 
   need service_provider_name from another table related through service_provider_id.
 * if it was parent table, i figure things out but it is child table
 *  Plugin Author [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * (@peterschulznl)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/database-relations/#post-16168270)
 * Hi [@recepbala](https://wordpress.org/support/users/recepbala/),
 * Data Projects supports parent-child relationships only. Parent-child-grantchild
   is not supported (not yet). For the child-grantchild relationship you need to
   use a dynamic hyperlink.
 * That hyperlink needs to redirect the user to a second project showing the child-
   grantchild relationship. You can get the url to that project by executing it.
   On the front-end you’ll need to jump to another page. On the back-end you just
   need to change the page argument.
 * But this just brings the user to the list table of the child table, which is 
   now the parent table (hope I’m clear…?). To directly jump to the data entry form(
   which I presume is what you want) you need to add two arguments:
    action=edit
   pk_key=pk_value
 * Where pk_key represents the column name of the primary key and pk_value represents
   the primary key value. If your primary key consist of multiple column, you need
   to add each column name and value. The plugin will automatically pick up these
   values.
 * This is the more advanced stuff! 😉 Let us know if you get stuck.
 * Have a nice weekend,
    Peter

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

The topic ‘Database Relations’ 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/)

 * 5 replies
 * 3 participants
 * Last reply from: [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * Last activity: [3 years, 7 months ago](https://wordpress.org/support/topic/database-relations/#post-16168270)
 * Status: resolved