Jump to content

Backup


mtgriffiths

Recommended Posts

Never tried this, but i think it'll work:

 

<?php
$file = 'backup' . date("m-d-y") . '.sql'; //set also the date in the filename
$resultsBackup = mysql_query("SELECT * INTO OUTFILE '$file' FROM yourtable");
?>

 

To restore it:

 

<?php
$file = 'backup04-19-08.sql';
$resultsRestore = mysql_query("LOAD DATA INFILE '$file' INTO TABLE yourtable");
?>

Link to comment
https://forums.phpfreaks.com/topic/101869-backup/#findComment-521377
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.