hello please make mysql statment in php for wordpress

lion_boy877

Active Member
1,841
98
48
2009
1,015
hello i need help i am using wordpress and i want something like that

PHP:
if {

original text will show

} else {
SQL:
UPDATE wp_postmeta SET `meta_value` = REPLACE (`meta_value`, 'text you want to replace, 'Replacement text here');
PHP:
}

Here is mysql code which is working fine when execute in phpmyadmin
SQL:
UPDATE wp_postmeta SET `meta_value` = REPLACE (`meta_value`, 'text you want to replace, 'Replacement text here');

i want to use it in php format which will work in php when post open on front end which and if else statement run and then else part will auto run and change text in mysql permanently


the meta_value is in longtext format where i want to replace specific word for specific condition do not change every text in that meta_value


if this is not good way then tell me how to do same thing with

PHP:
wp_update_post( );
Help me out guys
Post automatically merged:

my main purpose is i want to replace text via php coding in mysql table >> wp_postmeta and meta_key >> bulk links and meta_vlaue storing links in longtext format field and it will done auto if condition meet in if else statement
Post automatically merged:

i finally made solution by my self :) it took whole 1 day to work on very simple thing :D for me its a very big thing lol :P
 
Last edited:
1 comment
Top Bottom