Navigation überspringen

[Gelöst] Use sql to get data from 2 different post types with a m2m relationship

This support ticket is created vor 10 months, 2 weeks. 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Zeitzone des Unterstützers: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 1 reply, hat 1 Stimme.

Zuletzt aktualisiert von Minesh vor 10 months, 2 weeks.

Assistiert von: Minesh.

Author
Artikel
#2815474

Hello I am trying to get data with mysql from two different post_types that are related with a many to many relationship. The site is locally installed. Where can I find sql examples? Thanks in advance

#2815519

Minesh
Unterstützer

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - you can use the post relationship API function "toolset_get_related_posts":
- https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_posts

Alternatively, you can also use the WP_Query way:
- https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/how-to-migrate-your-site-to-new-post-relationships/