?
Solved

Need Mysl query for find and replace a field

Posted on 2013-11-16
2
Medium Priority
?
413 Views
Last Modified: 2013-11-16
Hello

I have little experience in making modifications in mysql.  But thanks to Experts-Exchange I am able to make little changes, via phpmyadmin.

I have a database named "foobar" and one of the tables in it is named "foobar_menu",  And in that table is a field named "params"

I would like the query to search the params field for (include all the quotes) :

"show_page_heading":1,"

And replace it with

"show_page_heading":0,"

That's "all" I want it to do.  An exact match and exact replace

phpMyAdmin - 2.11.11.3
MySQL client version: 5.0.95
Server version: 5.0.95-log

And, yes I have a backup of the database.

Thanks!

Rowby
0
Comment
Question by:Rowby Goren
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 39654097
Running directly in PHPMyAdmin?

UPDATE foobar_menu set params=REPLACE(params,'"show_page_heading":1,"', '"show_page_heading":0,"' )

Open in new window

0
 
LVL 9

Author Comment

by:Rowby Goren
ID: 39654106
That did it!

Thanks!

Rowby
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

649 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