I'm having trouble. Instead of launchin script
UPDATE table_name SET field=value WHERE id=12345
I launched
UPDATE table_name SET field=value
Database is backuped every day (with mysqldump). What is the simpliest way to restore the value of that column using the backup. obviously I cannot apply that backup dirrectly as database is continiously changed.
Thank you in advance!!
I would create a new table 'table_name2' identical to your 'table_name' but containing the data of your backup.
Then use this query:
UPDATE table_name SET
table_name.field = (SELECT table_name2.field
FROM table_name2
WHERE table_name.id = table_name2.id)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With