0
我使用此代碼在服務器端下載MySQL數據庫它工作正常,但我不知道如何在客戶端上下載數據庫,請幫助。MySQL數據庫的客戶端下載
include'connect.php';
if(isset($_POST['download'])){
$time = time();
$current_date_time = date('[email protected]', strtotime('+3 hours'));
$backupFile = 'D://xampp//htdocs//development//ShahrajeTraders//backup//'.$database.'~'.$current_date_time.'.sql';
$command = "D://xampp//mysql//bin//mysqldump.exe -h $host_name -u $user_name -p$user_pass $database > $backupFile";
system($command);
if($command){
echo'
<script>
$(document).ready(function(){
alert("Download Completed.");
});
</script>
';
}else{
echo'
<script>
$(document).ready(function(){
alert("Error During Downloading.");
});
</script>
';
}
}
只需打開文件並將數據流傳輸給用戶? – Sumurai8
重複btw:http://stackoverflow.com/questions/737045/send-a-file-to-client – Sumurai8