I'm try to do a dump of my db in this way:
$output = NULL;
$command = 'mysqldump -u $dbuser -h localhost -p$password $dbname > dump.sql';
passthru($command, $output);
I've tried in this way too:
$command = 'mysqldump -u $dbuser -h localhost -p$password $dbname > dump.sql';
exec($command);
In both ways it create an empty dump.sql
Where am I wrong? Can you help me?