I have this mysql query:
UPDATE `table`.`wp_12_postmeta`
SET `meta_value` = 'yyy'
WHERE `wp_12_postmeta`.`meta_id` =5
LIMIT 1 ;
How to enable this:
- instead
wp_12_I need a variable $prefix(the variable contains wp_4_, wp_3_, etc.) - instead
yyyI need a value $perf(variable - name) - instead
5I need a value $meta_id(variable - nr)
Thanks u!
PS
here is what i use and it works:
$wpdb->query("UPDATE ".$prefix."postmeta SET meta_value = '".$perf."' WHERE meta_id = '".$meta_id."' LIMIT 1 ");
The problem is that when I execute this request, the meta field is updated, not just one. Ty
source
share