We are using WPdatatables and Toolset for a client. In Toolset we made sevaral CPT. Now we want to use a SQL query tot retrieve data out of the CPT and present them tot the user with wpdatatables. Now the query is difficult because there are several cpt and the are related to each other. So there are employers who have employees and the employeer do educations. Alle tree in different tables in a 1:n way. The SQL is to difficult voor the wizards in WP datafabels en to dificalt for us. Do you have a service to make SQL querys for us?
Sorry for late response we did not work in past 4 days due to national holidays.
When you have some complicated queries our suggestion is to make a MySQL view (a stored query), which will return the data that you need, call it e.g. “view1” and then build a wpDataTable based on a simple query like “SELECT * FROM view1″.
We do have paid customisation service where you can hire one of our developers to help you out with writing queries.
Thanks for your reply. Would you please read the answer of the Toolset developer:
-----------
The WordPress Database GUI would, in my opinion, be the right tool to use, but clearly, the plugin does not support post meta query.
The SQL tool on the other hand for me is confusing, misleading, and if you do not 100% understand SQL, you will not be able to craft proper queries above basic ones.
So I went the manual way, and came up with this example, based on the below data which I already shared above.
1. The Toolset refers to related Post Types with the hidden custom field "_wpcf_belongs_{parent-post-type-slug}_id
2. That field will hold the ID of the parent Post.
3. In the new Many To Many, this won't work anymore
The query below will get all posts that are of type "xy", and belong to a post with ID "xy".
It returns now the post ID and field slug, but that can be changed as you know.
As you see you will need to pass the ID of the parent Post you look for in the child post type.
Please edit:
ID, PostMeta Key, Post Type as per your needs.
This plugin required high knowledge of SQL in my opinion, to make queries like this.
The GUI (for me) was not enough.
I might miss something of course.
Above SQL should give a good example how to build the query.
Can you please tell me did you try to make a VIEW from the query below.
If you take a look at our documentation you will see this notice:
Please note: this tool is not an ultimate query generator. It simply constructs a suggestion of a query. We are constantly working to improve it, but SQL is such a complicated and flexible language that full automation for constructing queries is next to impossible. Consequently, the more complicated the query, the higher is the probability that it will not return exactly what you need. So, you will often need to play around with the resulting query.
I am not very familiar with the Toolset but looking at the query I think the VIEW can help you .
We need a query on the CPT made by Toolset that retrieve the data form the CPT 'werkgevers' related to 'werknemers' related to 'opleidingen' related to 'beoordelingsformulieren' related to 'beoordelingsbestanden'.
We are using WPdatatables and Toolset for a client. In Toolset we made sevaral CPT. Now we want to use a SQL query tot retrieve data out of the CPT and present them tot the user with wpdatatables. Now the query is difficult because there are several cpt and the are related to each other. So there are employers who have employees and the employeer do educations. Alle tree in different tables in a 1:n way. The SQL is to difficult voor the wizards in WP datafabels en to dificalt for us. Do you have a service to make SQL querys for us?
HI jaspijk,
Thank you for your purchase.
Sorry for late response we did not work in past 4 days due to national holidays.
When you have some complicated queries our suggestion is to make a MySQL view (a stored query), which will return the data that you need, call it e.g. “view1” and then build a wpDataTable based on a simple query like “SELECT * FROM view1″.
We do have paid customisation service where you can hire one of our developers to help you out with writing queries.
Best regards.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Bogdan,
Thanks for your reply. Would you please read the answer of the Toolset developer:
-----------
The WordPress Database GUI would, in my opinion, be the right tool to use, but clearly, the plugin does not support post meta query.
The SQL tool on the other hand for me is confusing, misleading, and if you do not 100% understand SQL, you will not be able to craft proper queries above basic ones.
So I went the manual way, and came up with this example, based on the below data which I already shared above.
1. The Toolset refers to related Post Types with the hidden custom field "_wpcf_belongs_{parent-post-type-slug}_id 2. That field will hold the ID of the parent Post. 3. In the new Many To Many, this won't work anymore
The query below will get all posts that are of type "xy", and belong to a post with ID "xy". It returns now the post ID and field slug, but that can be changed as you know.
SELECT wp_posts.ID, wp_postmeta.meta_key
FROM wp_posts
JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id
AND wp_postmeta.meta_key =
'_wpcf_belongs_toolset-parent_id'
WHERE wp_posts.post_type =
'toolset-post-type'
AND wp_postmeta.meta_value =
'40'
order by wp_posts.ID asc
As you see you will need to pass the ID of the parent Post you look for in the child post type. Please edit: ID, PostMeta Key, Post Type as per your needs.
This plugin required high knowledge of SQL in my opinion, to make queries like this. The GUI (for me) was not enough.
I might miss something of course.
Above SQL should give a good example how to build the query.
-----------------------
Hi jaspijk,
Can you please tell me did you try to make a VIEW from the query below.
If you take a look at our documentation you will see this notice:
Please note: this tool is not an ultimate query generator. It simply constructs a suggestion of a query. We are constantly working to improve it, but SQL is such a complicated and flexible language that full automation for constructing queries is next to impossible. Consequently, the more complicated the query, the higher is the probability that it will not return exactly what you need. So, you will often need to play around with the resulting query.
I am not very familiar with the Toolset but looking at the query I think the VIEW can help you .
Best regards.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Bogdan,
We're stil straling with the query. Do you have a (payed) service tot make the query for us?
Jacques
Hi Jacques,
We do provide writing queries as the customization service.
Can you give us as much details as you can and also an example so we can estimate the price for this service.
Best regards.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Bodan,
You can read our 'problem' over here:
https://toolset.com/forums/topic/sql/
We need a query on the CPT made by Toolset that retrieve the data form the CPT 'werkgevers' related to 'werknemers' related to 'opleidingen' related to 'beoordelingsformulieren' related to 'beoordelingsbestanden'.
Jacques
HI Jacques,
I will forward this to my team and I will get back to you as soon as I have an answer.
Best regards.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables