Skip Navigation

[Resolved] SQL

This support ticket is created 6 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 17 replies, has 2 voices.

Last updated by Beda 6 years, 7 months ago.

Assisted by: Beda.

Author
Posts
#652099

As I outlined already, the Toolset Custom Fields are just normal WordPress Custom Post Fields.

The one you look for to get related posts is the only specific one:

_wpcf_belongs_{parent-post-type-slug}_id

All Custom Post Fields created by Toolset will as well have a special prefix:

wpcf-{your-field-slug}

The question of this Ticket was how to get related Posts with that Plugin.
The result is that one must fluently know SQL to achieve this.

Toolset's purpose is not to teach SQL or even encouraged to use it.
Its purpose is the exact opposite:
Avoid any form of coding.

With Toolset, it is possible to create Tables using the Views Plugin, this is the way we have to suggest.

I fear, for further customization of that SQL, given the information above, is subject to Custom Code.

With the information, we provided it is possible to create tables with that Plugin.
But it seems, the plugin is not able to build the Query with the GUI they provide.
Hence, SQL knowledge is required.

Or you could ask that Plugin's Support, how to create a Query with the software when your Custom Fields are:
- as outlined above

This would be the same problem if you would not use Toolset.
Assume you create a Custom Post Type with a hidden Custom Field, and a visible Custom Field using a Prefix.
That is usual in WordPress, nothing that requires any addon plugins actually.

Stil, with the Table Plugin you could not create the query unless you have advanced SQL knowledge, or they maybe have some settings to get hidden fields, which we oversaw.

However, this is not related to Toolset in this aspect.

Do you agree?

#653864

Beda,

Thanks for the reply. I totally understand that one can not ask support for other plugins end not getting an free SQL-course. I'm very grateful so far with your support.

As I mentioned I'm getting now a result with the query. I'm not using WPdataTables anymore now but Mysql tot do an SQL query to make an SQL view that I can use in other needs. So I'm only asking when I need a CPT field other than wp_posts.id, wp_postmeta.meta_key, wp_postmeta.meta_value, wp_posts.post_type what wil be on SELECT row for that. I think when I see that my problem will be solved. That would be great.

I've experimented with another way to achieve my goal. When I put Toolset in the debug modus and using a view I can see the SQL query that is used. But that query results in MySql in only the post and postmeta fields and not the toolset fields.

I wish Toolset will implement a function in the near future to export dat ato other formats. The View plugin is great but only shows results on the screen. I think I'n m not alone in the need to export data tot excel, CSV. Then we don't need the other plugins like Wdatatables, WP allexport, ..... Toolset is really mind-blowing but would be even greater than that when w can also export data.

Please make my day with some hints for our problem.

Jacques

#655790

I start to believe that there is a misunderstanding.

There are no such things like "Toolset Fields".

Toolset creates post meta fields, those are the ones you see on the front end in the query as well.
"Toolset fields" is something that does not exist.

Any Custom Field created with Toolset is a native post field.
Those are all holding wp_postmeta.meta_key and wp_postmeta.meta_value (more, but these 2 are the main ones you work with).
The only special is that the wp_postmeta.meta_key will always begin with a "wpcf-".
The HIDDEN field we spoke about for the relation is as well just a native Custom Field.
They can be hidden, WordPress uses hidden fields as well.
Hidden means, they are not visible and start with an "_" underscore.

But "Toolset Fields" as such do not exist, or I completely misunderstand what you mean.

There are features in progress to make Toolset a bit more "data provider" but mainly the focus is on "data display"