Page 1 of 1

amend mysql table column en masse

Posted: Fri Feb 24, 2012 8:17 pm
by inosent1
i have a mysql table called 'data' and 2 columns called 'id' and 'name'

there are 100 records where 'id' = "orange"

what i want to do is write some php code that says:

where id="orange" change name to say "hello'"

any ideas greatly appreciated

Re: amend mysql table column en masse

Posted: Fri Feb 24, 2012 8:19 pm
by Celauran
You don't need any PHP code to do that; do it directly in MySQL.

Code: Select all

UPDATE `data` SET `name` = 'hello' WHERE `id` = 'orange'