Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For example with the following query I can select all the records I want to change, but then how do do the change? e.g. change all occurences of "seven" to "four"?

SELECT * FROM `templates` WHERE `attrib_B` LIKE `seven`

This is how I think of it in pseudo code:

if `attrib_B` like `seven`:
    set `attrib_B` = `four`


share|improve this question
up vote 1 down vote accepted
UPDATE `templates` set `attrib_b` = 'four' WHERE `attrib_B` like 'seven';
share|improve this answer
Just a side note that this is SQL and not specific to phpMyAdmin. – Michael Mior Jan 6 '10 at 21:58
thanks! that's perfect. I was pulling my hair out. :) – matt wilkie Jan 6 '10 at 22:01
I removed the phpmyadmin specificity – matt wilkie Jan 6 '10 at 22:04

[for myPHPAdmin as per original question verbiage]

You can use either the table editor to change the data rows manually (via web interface) or run a SQL UPDATE statement.

Manually updating via web interface:

  1. Click on your table in the menu on the left
  2. Click the Browse tab, which will display the data rows in an HTML table
  3. Click Edit on the row(s) you want to edit
  4. Change the values in the Edit form

Running a SQL UPDATE statement (faster as you can do them all at once):

  1. Click on your table in the menu on the left
  2. Click the SQL tab, which will give you a textbox you can enter a SQL statement into
  3. Use this SQL statement to update all the rows:

    UPDATE 'templates' SET 'attrib_B'='four' WHERE 'attrib_B' LIKE 'seven'

  4. Click the GO button to execute the statement

share|improve this answer
thanks squillman. Perhaps preface your answer with [For phpmyadmin] or similar as I've removed that from the question and it now appears out of context, but isn't. sorry for adding confusion! – matt wilkie Jan 6 '10 at 22:06

The question has already been answered, so I won't redo that but thought it might be handy to pass on a little tip for the future. It's helped me avoid excessive page turning of the manual many times.

An easy way to search the MySQL documentation is to use the URL, followed by your search term. e.g. ignore

will search the online documentation for "insert ignore".

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.