我已经建立了一个自定义帖子类型的"成绩。"在其中我使用名为"赋值"的高级自定义字段转发器字段。在转发器"赋值"字段是这三个重复的子字段," assignment_name"," date_of_completion"和" grade"。
我安装了一个接受MySQL数据库查询的报告插件。我的问题是,我无法获取查询以获取通过ACF添加的任何元数据。我使用phpmyadmin查看了数据库,看起来metakey根据帖子中添加了多少重复字段而有所不同。
如何针对不断变化的meta_key修改此查询?
到目前为止,我的查询是非常感谢。
SELECT p.post_id,
pm.assignment_0_assignment_name, //An always changing metakey based on number of repeating entries
pm.assignment_0_date_of_completion, //An always changing metakey based on number of repeating entries
pm.assignment_0_assignment_grade//An always changing metakey based on number of repeating entries
FROM wp_posts p
INNER JOIN wp_postmeta pm
ON p.post_id = pm.post_id
WHERE p.post_type = 'grades'
AND p.post_status = 'publish'