i found some simple code for dumping mysql database but whatever i do (change path to mysqldump, change arguments, change functions) it generates 0 bytes file every time! why is this happening? how could i debug my code?
$user="*********";
$password="*****";
$database="*********";
$dumpCommand='/usr/bin/mysqldump';
$dumpCommand.=" -e -f -u$user -p $password"; // -f to force dump even if errors
$dumpCommand.=" $database";
$dumpCommand.=" > bekap.sql";
$results=$dumpCommand;
exec($dumpCommand);
echo "result: ".$results;