I connected to the db and successfully pulled products data. Now I want to to display products from specific category. The store is using woocommerce. The landing page is in different location so I can't import wp functions.
Here's what I come up with so far:
SELECT ID, `post_date` , `post_title` , `post_content` , `guid` FROM `wp_posts` as post INNER JOIN wp_term_relationships rs ON rs.object_id = post.ID INNER JOIN wp_terms t ON t.term_id = rs.term_taxonomy_id WHERE `post_type` = "product" AND `post_status` = "publish" AND rs.term_taxonomy_id = 117 ORDER BY post_date DESC LIMIT 5
Nothing happens. If I remove
AND rs.term_taxonomy_id = 117 it works as it did before. 5 oldest product appears. Not the products from specific category. What am I missing here?