如何将产品属性从数据库导入到新数据库?

时间:2019-05-27 13:34:14

标签: woocommerce

我想将所有属性从数据库导入新的woocommerce项目数据库。我只是不能接受术语,关系,分类表并将它们插入到新数据库中。只是感觉不对。

我可以获得链接到产品的属性。

SELECT DISTINCT
     p.post_title AS 'Product Name',
     t.name AS 'Term Name',
     tt.taxonomy AS 'Term Type',
     tt.description AS 'Term Description'
FROM
     wp_posts AS p
INNER JOIN
     wp_term_relationships AS tr ON p.id = tr.object_id
INNER JOIN
     wp_term_taxonomy AS tt ON tt.term_taxonomy_id = tr.term_taxonomy_id
INNER JOIN
     wp_terms AS t ON t.term_id = tt.term_id
WHERE
     p.post_title = ProductName
AND
     p.post_type = 'product';

我只想要每个属性和值。我该如何实现?

0 个答案:

没有答案