hi,
i would like to know how this can be done. lets say i have this in my database "first" and if i want to update and add the "second" in which i can have this format "first, second".
i used this UPDATE table SET number="second"
but it removes the "first".
i am using php and mysql,
thank you
views:
88answers:
3I guess you mean:
// if number is "first", it will become "first, second"
UPDATE table SET number = CONCAT(number, ", second")
but I don't think that's what you need. Can you explain what you are trying to do?
The update answer you've chosen gives you what you want. I want to chime in with somethings that you may find useful.
Since you are obviously learning, let's ensure that you get some related items covered as well:
Database and Code Backup: Keep the original safe before you start having your fun with it. If something goes wrong, you can always restore from backup and move on.
Souce Code Control: Keep your code under Source Code Control so that you can go back to previous versions as and when required.
Separation of Prod and Dev: If you play in Production, you have the ability to cause a lot of damage. Make double triple sure that you are working in an isolated environment.