我的Wordpress数据库不知怎的搞砸了。
我正在使用ACF转发器字段,即使我有多达12个重复元素,转发器计数也显示为零。
我正在尝试更新转发器计数,以便字段值在admin中正确显示。
update wp.sd_postmeta set meta_key = ( SELECT count(*) as count FROM wp.sd_postmeta where meta_key like 'child_products_%_sku%' and post_id = pid) where meta_key like 'child_products' and post_id = pid
或
update wp.sd_postmeta set meta_key = ( SELECT count(*) as count FROM wp.sd_postmeta where meta_key like 'child_products_%_sku%' and post_id = pid) where meta_key like 'child_products' and post_id = pid
问题是,如何为pid生成值?我想使用meta_key的child_products遍历所有帖子。