shell_exec not returning any errors?
Posted: Tue Jul 18, 2006 3:40 am
Hi everyone..I'm fairly new to PHP and I'm stuck with this problem..I have this snippet of code that won't work as expected
This does work however when I pass in a false $db_name it should generate an error but it doesn't
It seems like shell_exec is not getting the error message from mysql
I have tried to e.g.
echo shell_exec("error command");
and is giving me an error..
what's wrong with shell_exec not retrieving error message when used mysqldump command??
Code: Select all
$db_host = "localhost";
$db_port = "3306";
$db_name = "myDatabase";
$db_dump = "db.sql"
$result = shell_exec("mysqldump --host=$db_host --port=$db_port --opt $db_name > $db_dump &2>1");It seems like shell_exec is not getting the error message from mysql
I have tried to e.g.
echo shell_exec("error command");
and is giving me an error..
what's wrong with shell_exec not retrieving error message when used mysqldump command??