HaLo2FrEeEk Posted March 11, 2007 Share Posted March 11, 2007 Hi, I have a .sql backup of my entire database, and I want to have a php page that will restore that file to a certain database, the query I am using is this: mysql_select_db("test_forum"); $tableName = 'test_forum'; $backupFile = 'test_forum.sql'; $query = "LOAD DATA LOCAL INFILE '$backupFile' INTO TABLE $tableName"; $result = mysql_query($query) or die("Failed: ".mysql_error()); I can see the problem in this code too, its right here: INTO TABLE $tableName I don't want to restore into a table, I want to restore the entire database. Is there something I'm missing, or is this not possible? Link to comment https://forums.phpfreaks.com/topic/42264-restoring-a-mysql-backup-from-file/ Share on other sites More sharing options...
HaLo2FrEeEk Posted March 11, 2007 Author Share Posted March 11, 2007 I also want to be able to restore the contents of a zip archive to a certain folder, my host told me that zip functions are not enabled on the server, but I can use gzip, only thing is, I don't know how I would go about doing this, any help on this would be appreciated. Link to comment https://forums.phpfreaks.com/topic/42264-restoring-a-mysql-backup-from-file/#findComment-205027 Share on other sites More sharing options...
HaLo2FrEeEk Posted March 11, 2007 Author Share Posted March 11, 2007 help please. Link to comment https://forums.phpfreaks.com/topic/42264-restoring-a-mysql-backup-from-file/#findComment-205041 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.