Values inserting in 3 table
Table1: wp_terms
Table2: wp_term_taxonomy
Table3: wp_term_relationships
I need ouput like this(i want fetch all brand and designer based on category)
I have tried this
$sql="select term_taxonomy_id from wp_term_taxonomy where term_id=177";
mysql_query($sql);
I got output 251
But I am stuck in Table3: wp_term_relationships on how to fetch data where object_id
are similar: 550, 540(for category, band, designer )
I guess the query shd look like this:
SELECT m.name, t.taxanomy, t.description from wp_term_relationships r
INNER JOIN wp_term_taxonomy t on r.term_taxonomy_id = t.term_taxonomy_id
INNER JOIN wp_terms m on m.term_id=t.term_id
WHERE (r.object_id=550 or r.object_id=540) and t.term_id=177
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.