Ok I am looking for an sql query to insert meta_key & value in a specific table IF another value exist.
I am new with phpmyadmin and I really need help.
This is what I have so far:
SELECT * FROM `wp_postmeta` WHERE `meta_key` LIKE 'qty' AND `meta_value` LIKE '0'
the previous query is only to filter the meta_key values.
I have also try to create something with my little knowledge but also is not working:
I need an sql query to do this:
INSERT INTO `wp_postmeta` WHERE `meta_key` LIKE 'qty' AND `meta_value` LIKE '0'(`meta_key`, `meta_value`) VALUES ([_wplp_post_front],)
Search the wp_postmeta table for posts with meta_key "qty" and "0" meta_value
after that I need to insert to those posts a new meta_key "_wplp_post_front" with value "1"
I'm sure this is a simple query but I can't work it out!