0

Lets say I have this table.

 ID  Message

 1   Jack went to the park.
 2   Jamie went to the store.
 3   Lucy finished school.

How can I mass insert values into the Message column without completely overwriting the existing value?

For example

 ID  Message

 1   Jack went to the park **at 3pm**.
 2   Jamie went to the store **at 3pm**.
 3   Lucy finished school **at 3pm**.

I know I could do this via PHP by retrieving the values and then re-inserting them with the additional value via an array/loop but I wish to do this purely with MySQL via PhpMyAdmin.

ProEvilz
  • 5,310
  • 9
  • 44
  • 74
  • Look up `REPLACE` for MySQL – Jay Blanchard Feb 26 '15 at 15:37
  • 2
    possible duplicate of [Appending data to a MySQL database field that already has data in it](http://stackoverflow.com/questions/2761583/appending-data-to-a-mysql-database-field-that-already-has-data-in-it) – leigero Feb 26 '15 at 15:39

1 Answers1

2
UPDATE `table`
   SET `Message` = CONCAT(`Message`, " at 3pm")
 WHERE 1;
n-dru
  • 9,285
  • 2
  • 29
  • 42