Welcome to WebmasterWorld Guest from 54.211.17.91

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)

WebmasterWorld Senior Member 10+ Year Member



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)

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



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)

WebmasterWorld Senior Member 10+ Year Member



:) Thank you, that saved hours.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month