Welcome to WebmasterWorld Guest from 54.156.36.82

Forum Moderators: open

Message Too Old, No Replies

Replace values in table

Alter value in one field, all rows of a table

     
4:50 pm on Apr 5, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Aug 29, 2003
posts:944
votes: 0


I am not good with MySQL but I think there must be a simple way in PHPMyAdmin to do what I need to do.

Basically I have a table of products, a few thousand of them, and they all have a value in the field pWeight of 0. I want to change them to all have a value of 1.

I could go through the lot and edit each record, but I am sure there must be a quicker and simpler way to do it.

8:54 pm on Apr 5, 2008 (gmt 0)

Administrator

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 31, 2003
posts:12547
votes: 2


UPDATE myTable SET pWeight = 1;

I always make a backup of tables before doing something like this, you may want to do the same!
9:53 pm on Apr 5, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Aug 29, 2003
posts:944
votes: 0


:) Thank you, that saved hours.