I have a table with 4 values, meta_id, post_id, meta_key and meta_value, and I want to change all meta_values found as “yes” to “si” when the meta_key is stock_available… how do I do this?. I cannot even retrieve the rows at this point…I’m trying with something like this.
SELECT `meta_value` FROM `wp_postmeta` WHERE `meta_key` AND `meta_value` = 'yes'
Could I have some help?
EDIT: I had forgotten the meta_key…
SELECT * FROM `wp_postmeta` WHERE `meta_key` = 'stock_available' AND `meta_value` = yes'
So I retrieve these… btu how do I update them?
You need to use the SQL
UPDATEstatement:Before you do that, run this
SELECTto make sure that you are going to be updating the correct rows: