Skip to content
WJunction - Webmaster Forum

how to replace some text separated with new lines in mysql ?

Status
Not open for further replies.
hi

i have some posts which have some text like this
Code:
</p>
</div>
</span>

i want to replace them into

Code:
</code>
</div>
</span>

any help ?

__________________
Added after 15 Hours 36 minutes:

any reply ?
 
Last edited:

7 comments

in your case
Item to replace here = </p>
Replacement text here = </code>
within quotation

Note- make a backup of your Database before doing any thing
or test it in a demo Wordpress installation
Since PHPmyAdmin is difficult for new users


 
in your case
Item to replace here = </p>
Replacement text here = </code>
within quotation

Note- make a backup of your Database before doing any thing
or test it in a demo Wordpress installation
Since PHPmyAdmin is difficult for new users



i cannot replace the </p> with the </code>

since i have other </p> in my posts but in the first lines

i want to delete the last line of some posts (over 200 posts)

and that last line contains some codes which are the same as some wanted codes in the first lines

got it ?
 
You would need to check in phpmyadmin DB, post table to see how the code is stored, from your 1st post it would be

PHP:
UPDATE wp_posts SET post_content = REPLACE (post_content, '</p>
</div>
</span>', '</code>
</div>
</span>');
 
There are many ways.

You could browse the post table, click on a post_content box to edit entry, add a space or something then click another entry so that saves, then phpmyadmin will show you the update query, so you will see the exact query.

OLelULR.png
 
Status
Not open for further replies.

About the author

D
Active Member · Joined
2,777
Messages
589
Reactions
113
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom