Hi
I have a Mysql database with several tables, In this database I've got a table where I save information every day, I have a PHP script for backing up a Mysql database, This my code:
I save the backup in a file and I can restore manually all my database using the followinmg command line:
This works fine But When I restore the database from an old backup It just keep the information from the backup an the current database informaction is deleted, I just want to append the backup data to my database without deleting the current information (Or Restore the information from a selected table and append it)
Any ideas?
Thanks
I have a Mysql database with several tables, In this database I've got a table where I save information every day, I have a PHP script for backing up a Mysql database, This my code:
Code:
<?php
//Current Date
$Date = date('Y-m-d');
//My BD
$user = "root";
$passwd = "passsword";
$bd = "users";
//Make the backup
$execute = "c:\wamp\bin\mysql\mysql5.0.51a\bin\mysqldump.exe -u $user --password=$passwd --opt $db > c:\backup\mydb_$Date.sql";
system($execute, $result);
if ($result) {
echo "<H1>Error on: $execute</H1>\n"; }
else {
echo "Backup Ready: ". $Date; }
?>
I save the backup in a file and I can restore manually all my database using the followinmg command line:
Code:
mysqldump -u root -p --all --add-locks -e mydb > mydb_Date.sql
This works fine But When I restore the database from an old backup It just keep the information from the backup an the current database informaction is deleted, I just want to append the backup data to my database without deleting the current information (Or Restore the information from a selected table and append it)
Any ideas?
Thanks