Re: exec("mysql -h hhh -u uuu -pppp <test.php",$out,$bin);

From: Date: Wed, 25 Oct 2006 20:27:01 +0000
Subject: Re: exec("mysql -h hhh -u uuu -pppp <test.php",$out,$bin);
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-243629@lists.php.net to get a copy of this message
BINGO :) ERROR 2005 (HY000): Unknown MySQL server host 'hhh' (1)Array ( [0] => ERROR 2005 (HY000): Unknown MySQL server host 'hhh' (1) ) 1 Can you explain a bit more what this do ? 2>&1 For example will i only get stderr or do i get stdout and stderr messages ? On 10/25/06, Stut <stuttle@gmail.com> wrote:
Gert Cuykens wrote: i do not get any output from mysql except form echo $bin that displays 1 ? <?php exec("mysql -h hhh -u uuu -pppp <test.php",$out,$bin); print_r($out); echo $bin; ?> I don't know for sure but chances are that mysql outputs errors on stderr not stdout, so you need to redirect stderr to stdout for exec to capture it... exec("mysql -h hhh -u uuu -pppp < test.php 2>&1",$out,$bin); -Stut


« previous php.general (#243629) next »