HaLo2FrEeEk Posted March 27, 2007 Share Posted March 27, 2007 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/44543-restoring-a-sql-db-backup-using-php/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.