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 Quote 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. Quote 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 Quote 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! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.