LanceT Posted January 29, 2007 Share Posted January 29, 2007 So i have a field, and I want to add onto the field instead of changing/replacing the whole field. What is the syntax for this?Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/36138-adding-onto-a-field-in-mysql/ Share on other sites More sharing options...
toplay Posted January 29, 2007 Share Posted January 29, 2007 I'll assume you're talking about adding a string value to an existing column value. It depends where you want to add the additional data within the existing value (at the beginning, middle somewhere, or at the end).Here's an example of appending data to an existing field:UPDATE `table_name` SET `column_name` = CONCAT(`column_name`, 'new data goes here') WHERE ....some condition....;See manual page:http://dev.mysql.com/doc/refman/5.0/en/string-functions.html Quote Link to comment https://forums.phpfreaks.com/topic/36138-adding-onto-a-field-in-mysql/#findComment-171614 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.