如果您正在查找原始SQL查询,那么这应该会有帮助:
UPDATE <PREFIX>postmeta SET meta_value = \'temp4\' WHERE meta_value = \'temp1\' AND meta_key = \'post_template\'
如果要从WP运行此查询,则可以使用:
global $wpdb;
$wpdb->update(
"{$wpdb->prefix}postmeta",
array( \'meta_value\' => \'temp4\' ),
array( \'meta_key\' => \'post_template\', \'meta_value\' => \'temp1\' )
);