In a previous question I enquired about the use of the SQL command LOAD DATA FILE and in the responses I was put into the track of using mysqldump to handle database backups, I got a little help in the understanding of this function but am now very stuck trying to get it to work.
Below is my code, please have a look and if you can see where I am going wrong could you possibly explain and show where? I have looked tirelessly on the net to try and find how to get my code to work but to no avail,
//Database Information
$dbhost = "localhost";
$dbname = "foobar";
$dbuser = "foo";
$dbpass = "bar";
if (isset($_POST['backup'])):
$command = "mysqldump --opt -host=$dbhost --user=$dbuser
--password=$dbpass $dbname > /sql/backup/verypc.sql";
system($command);
endif;
Many thanks in advance anyone helping out.
You have
-host=$dbhostinstead of--host=$dbhost.