auto update a table

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
abionifade
Forum Commoner
Posts: 34
Joined: Thu Apr 18, 2002 5:32 pm

auto update a table

Post by abionifade »

I have just inserted a new coloumn into an existing mysql table that has been in use for quite a while. I would like to insert the value 'sold' into that coloumn for every record that exists within the table.

is there a mysql line that i can type into the command line that will do this for me?

Thanks!
rev
Forum Commoner
Posts: 52
Joined: Wed Oct 02, 2002 3:58 pm
Location: Atlanta, GA

Post by rev »

update tableName set columnName = 'value';

This will set columnName to value in every record within tableName.
Coco
Forum Contributor
Posts: 339
Joined: Sat Sep 07, 2002 5:28 am
Location: Leeds, UK
Contact:

Post by Coco »

add a new collumn with a default value of sold.....
Post Reply