How would you massively assign a value to all rows of a column in a sample, in phpMyAdmin? The table has an empty column and rows with values ​​1 and 0. I would like to set all rows with value 1 to 0.

  • one
    > in the sample, in pma> lines with a value of 1, the value of 0, commas are not needed. The following query will put the value 0 in the empty field for all records whose string_column value is one. The names of the tbl table and the tbl string fields string_column be replaced with their own, of course. UPDATE tbl SET empty = 0 WHERE string_column = '1' - etki
  • those. just by request? Thank. - Alex Lapin
  • @Alex Lapin, honestly, I don’t know, the request is more familiar - etki
  • @Fike, like this a bit more correctly UPDATE tbl SET empty = 0 WHERE empty = '1' - mountpoint

2 answers 2

Reply from comments

The easiest way to accomplish this is with an SQL UPDATE query.

 UPDATE tbl SET empty = 0 WHERE empty = 1 

    Update tbl set empty = 0 where 1