Php Mysql Update

Hi,

I have a table that needs to be updated, but the current value must not be replaced! This is the scenario: “…a manager add’s employees under his profile. so if Manager A adds Employee A it would be a standard SET, but now Manager B also want’s to add Employee A to his profile. This is where I lose it…”

The result should be:
Employee Manager
Employee A Manager A, Manager B

How do I UPDATE the Manager field without replacing the existing data?

Your help would be appreciated
Kind regards

LOL… yea it seem to happen all the time, once you have lost it totaly and resort to the forum, you get the answer…

Well here it is:

UPDATE employees SET empl_manager = CONCAT(empl_manager,‘,Manager A’) where empl_username=‘Employee A’;

result of empl_manager: ,Manager A

UPDATE employees SET empl_manager = CONCAT(empl_manager,',Manager B) where empl_username=‘Employee A’;

result of empl_manager: ,Manager A,Manager B

Very easy…

I am totally blind about your field structure but just to append the field value you can do something like below:


UPDATE tblename SET Manager=CONCAT(Manager, ' ', 'New text goes here') WHERE manager_id=1;

Is it what you are looking for?