I have a list of records in a phpmyadmin table, I want to change the value of one field in all the records

10,115

You don't have a phpMyAdmin database: you have a MySQL database and you use phpMyAdmin as an administrative interface.

This distinction is important because with every relational database you can use SQL to insert/update records in your tables. That is exactly what phpMyAdmin does: under the hood it uses SQL to change the content of your tables.

Using SQL is a trivial thing changing thousands of records with a single statement, for example if the table is called atable and the column is called acolumn, you could do an update like this:

UPDATE `atable` SET `acolumn`=-3000 WHERE `acolumn`=0;

phpMyAdmin allows you to execute SQL code directly, but since it looks like this is the first time you try this, I strongly advise to make a backup first.

Share:
10,115
Admin
Author by

Admin

Updated on June 15, 2022

Comments

  • Admin
    Admin almost 2 years

    I have a phpmyadmin database, I have tables with records in them, if i select a bunch of records and then hit edit it give me a printout of all the records, but i want to change ONE field in one column for all the records checked without having to scroll and change EVERY record and then hit "go"

    any idea how to do that

    we are talking about thousands of records, I need to just change ONE field column from "-3000" to "0"

    Tried getting help in #PHPMYADMIN in IRC but everyone was sleeping i think

  • Admin
    Admin about 10 years
    Your The Best! Ill Try That!
  • Admin
    Admin about 10 years
    Your right of course, normally when i stare at this stuff its for a website, this time the DB is used on a automation system and the value is a fade point that needs to be altered, in the actual system its just a check box, but if i enter 0 it turns the check mary on, no idea what -3000 was for, it should have been 0=on 1=off, but i found out that with that knowledge i could manipulate it quickly, this being that it doesnt break the database lol