wpdb_prepare with multiple or condition

I think your first partial code be this partial code: $wpdb->prepare( “SELECT * … from … WHERE ( post_title LIKE ‘%%%s%%’ or post_content LIKE ‘%%%s%%’ )…, $string, $string ); You have to have to pass the same number of arguments into the query as you specify (with %s) in it.

how to remove category from database

It is done through the following query: delete from `wp_terms` where `term_id` in ( SELECT `term_id` FROM `wp_term_taxonomy` WHERE `taxonomy` = ‘category’ ) and `term_id` not like 1 This query deleted all the category except the default. Hope this helps to the others.

Cannot update custom database table row

Before trying to write to the database, always validate the values you’re putting in: $fValid = true; if ( !isset( $payment->status ) ) { echo ‘Error: Payment status is not set’; $fValid = false; } if ( !isset( $order_id ) ) { echo ‘Error: Order ID is not set’; $fValid = false; } if ( … Read more