WordPress数据库如何wp_posts tag1,tag2,tag3

时间:2016-11-22 12:57:53

标签: mysql wordpress

BAD

SELECT p.ID, tr.object_id, tr.term_taxonomy_id
FROM wp_posts p, wp_term_relationships tr
WHERE p.ID = tr.object_id

我想这样做,一个SELECT代码。

[ID: 1, object_id: 1, term_taxonomy_id: 1,12,13,15],
[ID: 2, object_id: 2, term_taxonomy_id: 15,18,19,25],
[ID: 3, object_id: 3, term_taxonomy_id: 13],
[ID: 4, object_id: 4, term_taxonomy_id: 7,31], 

协商

http://www.dimuthu.org/blog/2008/12/20/wordpress-database-relationship-with-tags-catagories-and-posts/

数据库描述

https://codex.wordpress.org/Database_Description

0 个答案:

没有答案