我在 wordpress 库中做了自己的自定义表格,现在我需要使用 wopdpress 表格中的数据更新表格(thundbail 链接)
这里选择查询
SELECT p.post_parent, guid
FROM wp_postmeta AS pm
INNER JOIN wp_posts AS p ON pm.meta_value=p.ID
WHERE pm.post_id = 1552
AND pm.meta_key = '_thumbnail_id'
ORDER BY p.post_date DESC
LIMIT 1
答案:post_parent (fullproducts = postid) | guid(完整产品 = 图像)
第1552章 网址
我尝试使用此代码更新此表
UPDATE full_products, wp_postmeta AS pm
SET full_products.image = wp_postmeta.guid
INNER JOIN wp_posts AS p ON pm.meta_value=p.ID
WHERE pm.post_id = full_products.postid
AND pm.post_id = 1552
AND pm.meta_key = '_thumbnail_id'
ORDER BY p.post_date DESC
LIMIT 1
但是这个查询不起作用。你能检查一下吗?