I am using the following code to try and execute a mysqldump
to save my tables and information.
Of course my username and password are included from my database class and they work fine.
$string = 'mysqldump -u'.$db->user.' -p'.$db->pass.' '.$db->db.' > /home/user/public_html/'.$filename;
$result=exec($string,$output);
if($output==''){ echo "Error"; }
else { echo "GOOD"; }
The script echo's the "GOOD" remark however the log file is empty. However if I run the string:
'mysqldump --help > /home/user/public_html/'.$filename;
It will print the help information to the file. So I have to ask, why isn't it working otherwise? Am I missing something as it did seem pretty straight forward.