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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.