devans725 Posted April 4, 2008 Share Posted April 4, 2008 The first statement executes fine, the other one doesn't? Not sure why not? Statement runs from command line with no errors. I don't receive any errors when php is run. I just don't get the results I want. I know the first statement works because the dumbfile.txt contains the correct information. The final hello.pdf does not contain the correct information. Any suggestions will be appreciated. <?php #!/bin/bash $state = $_POST["state"]; $gross = $_POST["gross"]; exec ("mysqldump --xml --skip-opt --no-create-info --compact --user=user --password=pass --where=gross='$gross' database_W2 > dumbfile.txt", $result); exec ("python /home/dir/public_html/draw.py", $result); echo (" <script language=JavaScript> <!-- Hide from JavaScript-Impaired Browsers parent.location=\"hello.pdf\" // End Hiding --> </script> "); ?> Link to comment https://forums.phpfreaks.com/topic/99576-exec-statement-not-executing/ Share on other sites More sharing options...
Paperstyle Posted April 5, 2008 Share Posted April 5, 2008 According to the exec() manual page: Note that if the array already contains some elements, exec() will append to the end of the array. If you do not want the function to append elements, call unset() on the array before passing it to exec(). It's talking about the second parameter to exec(). Link to comment https://forums.phpfreaks.com/topic/99576-exec-statement-not-executing/#findComment-509828 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.