hi,
say if i had fieldname and fieldname contained "value", i want to keep "value" and add ",value2" on to it.
would I have to select the information and put it into the new value or is there anyother quicker method?
adding information onto the end of a value in a field
Moderator: General Moderators
-
DynamiteHost
- Forum Commoner
- Posts: 69
- Joined: Sat Aug 10, 2002 5:33 pm
- mydimension
- Moderator
- Posts: 531
- Joined: Tue Apr 23, 2002 6:00 pm
- Location: Lowell, MA USA
- Contact:
yep, use the CONCAT_WS function: http://www.mysql.com/doc/en/String_func ... ml#IDX1163
just use that as the value you want to insert/update
i haven't tested this but according to the manual it should work.
Code: Select all
CONCAT_WS(",", column_value, "value2")Code: Select all
INSERT INTO table SET column_name=CONCAT_WS(",", column_name, "value2")