I am trying to remove some part from a SQL WHERE query. Although on Regexpal
I have no problem with my pattern, when I place the expression into preg_replace
it does NOT work.
An example of original not modified query WHERE part:
WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (800,801) ) AND wp_posts.post_type = 'service_photo' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') AND ( wp_postmeta.meta_key = 'custom_meta_partner_subscription_level' )
My code and pattern:
$where = preg_replace("(AND \( wp_term_relationships\.term_taxonomy_id IN \([0123456789,]*\) \))", "", $where);
return $where;
Do you have any idea what do I wrong?
PHP: 5.4.19
thanks