Everah wrote:If you are going to do this with PHP code (instead of using the wonderful suggestions already offered) you are going to need to change your query syntax to use database-name.table-name syntax. Even if you select a database to use.
i dont use any of the wonderful sugestions already offered, because i cant find a good example for my kind of problem, all i have found was this example, can you give me some tips about this code ?
is this code better than the other ?
correct me if i'm wrong, this code makes a backup of all DB, what i have to change here so i can make only a table backup and make that happen every 4 hours.
Code: Select all
<?php
include 'config.php';
include 'opendb.php';
$backupFile = $dbname . date("Y-m-d-H-i-s") . '.gz';
$command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > $backupFile";
system($command);
include 'closedb.php';
?>
this code is already working, now i'm getting all the DB backup, but now i want to backup only a specific table and then i want to transfer that to the same table but in a different DB how can i do that with msqldump ?
thanks in advance