如何在不删除旧数据的情况下更新数据库中的数据?

Sam*_*Sam 3 php mysql

我想知道如何做到这一点.让我说我在我的数据库中有"第一个",如果我想更新并添加"第二个",我可以将此格式设置为"第一个,第二个".我使用了这个,UPDATE table SET number="second"但它删除了"第一个".我正在使用php和mysql,谢谢

Tat*_*nen 5

我想你的意思是:

// if number is "first", it will become "first, second"
UPDATE table SET number = CONCAT(number, ", second")
Run Code Online (Sandbox Code Playgroud)

但我认为这不是你所需要的.你能解释一下你想做什么吗?