Reputation: 11
I have a database table that I store patient information in, along with files such as images and Word documents. when updating this table, it overwrites previous data stored. How do I prevent this from happening?
Upvotes: 0
Views: 6765
Reputation: 6604
According to your comment , first you need to backup the old values into other table with same columns data type :
insert into backup_table ( column1 , column2 , ... )
SELECT column1 , column2 , ...
FROM orginal_table
then update statement should look like this :
UPDATE orginal_table
SET column1=form_value1, column2=form_value2 ,...
WHERE some_column=some_value
Upvotes: 1