Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Queery String Questions

Status
Not open for further replies.

technobia

ISP
Sep 8, 2005
53
US
I have tried to do some search and replaces on my MySQL 5.x database via phpMyAdmin 2.11.5 and I mucked something up badly and had to start over with a new import.

I would like to avoid that again if possible since the data needs to be live on a website. So I need to be ABSOLLUTY SURE I will get the desired results. Although I understand queries, search and replace on text data, I am a newbie at MySQL & phpMyAdmin.

I would like to search a table "wp_posts" for no data in field" post_type" and replace it with the text string “post”

I have tired the following and it messed something up???

update wp01_posts set post_type = replace(post_type,'','post');

Also how do I define how to limit the querey to run on a small sample of records to test first before running it with confidence on the entire database.

I would also like to search table "wp_posts" for data "8" in field" post_author" and replace it with "3"

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top