Created
July 10, 2017 21:45
-
-
Save titodevera/9b7bbf555c2debe22eea899b93dbe3c6 to your computer and use it in GitHub Desktop.
Retrieve the brands for a product using SQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT t.*, tt.* FROM wp_terms AS t | |
INNER JOIN wp_term_taxonomy AS tt ON (tt.term_id = t.term_id) | |
INNER JOIN wp_term_relationships AS tr ON (tr.term_taxonomy_id = tt.term_taxonomy_id) | |
WHERE tt.taxonomy IN ('pwb-brand') AND tr.object_id IN (¡¡PRODUCT ID GOES HERE!!) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment