I am learning MySQL queries to be used with Wordpress....

What I know is query, which provides all cases of the custom area "description" the need for "test" when the area is NULL

UPDATE `wp_postmeta` SET `meta_value` = 'test' WHERE `meta_key` LIKE 'description' and `meta_value` is null

What I have to do is change that in order to email a category groups are saved in wp_term, like this: WHERE term_id = '3'

But, this throws a syntax error:

UPDATE `wp_postmeta` SET `meta_value` = 'test' WHERE `meta_key` LIKE 'description' and `meta_value` is null WHERE term_id = '3'

So I am doing a problem I am thinking the syntax that's associated with groups is a lot more complex than marking in another "WHERE".

You should not query SQL directly. There's an abstraction layer included in wordpress.

You ought to be while using wordpress_query function:


This can be it ?

UPDATE wp_postmeta SET meta_value = 'test' WHERE meta_key LIKE 'description' and meta_value is null AND term_id = '3'

On mine I experience the ` too

additionally, there are the update_publish_meta() function you need to consider


This really is off the top my mind. What you would like to make use of to update a category is wordpress_update_term

    'name' => 'new name',
    'description' => 'new description'

It's not necessary to include both title and outline, just include that certain that's altering. wp_update_term will merge this new data to the old data to ensure that only that which you provide is exactly what is transformed.

Since I have browse the publish again, I am unsure if the solutions it. I can not honestly tell what the aim of your SQL is...

Given that you ought to make use of the WordPress function if you are operating inside the WordPress engine, to create a valid SQL statement, turn your next "WHERE" into an "and" you'd possess a valid SQL query. You are explaining a 3-part WHERE statement, that could be proven as:

WHERE (`meta_key` LIKE 'description') AND (`meta_value` is null) AND (`term_id` = '3')