Database back up returning blank zipped file!

I’m trying to set up script which will backup my database and have the following script returning a blank zipped file with an error message that its corrupt:

<?php
include ‘config.php’;
include ‘opendb.php’;

$backupFile = $dbname . date(“Y-m-d-H-i-s”) . ‘.gz’;
$command = “mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > $backupFile”;
system($command);
include ‘closedb.php’;
?>

Try this:

$command = “mysqldump -h’{$dbhost}’ -u’{$dbuser}’ -p’{$dbpass}’ {$dbname} | gzip > {$backupFile}”;

thanks, but I’m still having the same problem, its returning a blank zipped file with the same error message.

Check the contents of $command, does it look correct to you?