Solved

Mass editing MySQL database

Posted on 2013-06-14
3
400 Views
Last Modified: 2013-06-19
What would be the proper way to edit a MySQL data table, replacing a value?  

I'm trying to, for instance, replace value "x" under 'post_type' with value "y" without possibly editing other columns.  

If that isn't possible (editing restricted to column) I would still like to know what the appropriate command is to run the REPLACE syntax on the entire table.
0
Comment
Question by:tbawarehouse
  • 2
3 Comments
 
LVL 4

Assisted Solution

by:Christopher Raymond Mendoza
Christopher Raymond Mendoza earned 500 total points
Comment Utility
Hello tbawarehouse,

Try this:
    UPDATE `table1` SET `post_type`="y" WHERE `post_type`="x";

More on the UPDATE statement:
    http://dev.mysql.com/doc/refman/5.0/en/update.html

Regards,
0
 

Accepted Solution

by:
tbawarehouse earned 0 total points
Comment Utility
Thanks for the response, however I found a much easier solution.

Using the MySQL Query Browser I simply enable editing then use the 'Search' function in the GUI to replace value "x" with value "y."  While it doesn't restrict to the post_type column, I was able to work around that small issue by using unique names for the fields I need.
0
 

Author Closing Comment

by:tbawarehouse
Comment Utility
Found the obvious I didn't see before.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

WordPress can be pretty daunting, especially for a beginner, so I thought it might be a good idea to write an article to show how easy it is to get started in WordPress and to design a custom theme.  The first step is to check with your hosting comp…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now