?
Solved

Need Mysl query for find and replace a field

Posted on 2013-11-16
2
Medium Priority
?
410 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

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.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to count occurrences of each item in an array.
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

770 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