I just moved to a new web host and they refuse to give me SSH access despite what their website's plan page shows I should have (I'm hating shared hosting. I miss my VPS), so I've decided to try restoring my MySQL database with PHP. After connecting to the database, my script basically runs mysql_query(include($database)) as seen here:
<?php
$host = "xxxxxxxx";
$user = "xxxxxxxx";
$pass = "xxxxxxxx";
$dbase = "xxxxxxxx";
mysql_connect($host,$user,$pass);
mysql_select_db($dbase) or DIE("Unable to select specified database!");
echo "Restoring database. Please wait....";
$query = include("vbulletin-xxxxxxxx.sql");
mysql_query($query);
echo "Congratulations! Restoration finished!";
mysql_close();
?>
When I try to execute this, I get problems with the file inclusion:
Warning: Unexpected character in input: '' (ASCII=21) state=1 in /xxx/xxx/xxx/xxx/xxx/vbulletin-xxxxxxxx.sql on line 277
Warning: Unexpected character in input: '' (ASCII=19) state=1 in /xxx/xxx/xxx/xxx/xxx/vbulletin-xxxxxxxx.sql on line 277
Parse error: syntax error, unexpected T_VARIABLE in /xxx/xxx/xxx/xxx/xxx/vbulletin-xxxxxxxx.sql on line 277
I'm fairly sure it's getting upset over a GIF image which is stored in the database (vBulletin stores attachments this way), but my forum has several attachments, and I can't remove them all.
Any suggestions as to how I can restore this database?