FD_F Posted June 28, 2009 Share Posted June 28, 2009 i have for example field called : SharedWith and he has value 1 i want add value 56, there is any way in update sql syntax to add and not erase all the field ? the result shuld be 1,56 now when i using UPDATE he erase 1 and put only 56 thanks Link to comment https://forums.phpfreaks.com/topic/163992-solved-add-data-to-exist-field/ Share on other sites More sharing options...
dzelenika Posted June 28, 2009 Share Posted June 28, 2009 UPDATE table SET SharedWidth = CONCAT_WS(',',SharedWidth, '56') ... Of course SharedWidth should be text(not numeric) type. But why you want to do this. I'm sure there's better solution. Link to comment https://forums.phpfreaks.com/topic/163992-solved-add-data-to-exist-field/#findComment-865104 Share on other sites More sharing options...
FD_F Posted June 28, 2009 Author Share Posted June 28, 2009 thanks works perfect Link to comment https://forums.phpfreaks.com/topic/163992-solved-add-data-to-exist-field/#findComment-865109 Share on other sites More sharing options...
fenway Posted June 28, 2009 Share Posted June 28, 2009 thanks works perfect Please use a where clause! Link to comment https://forums.phpfreaks.com/topic/163992-solved-add-data-to-exist-field/#findComment-865113 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.