On 03/03/2010 13:01, Paul Halliday wrote:
I need to pipe some data to an external application.
I have this:
while ($row = mysql_fetch_array($theData[0])) {
$src_ip[] = $row[0];
$dst_ip[] = $row[1];
$sig_desc[] = $row[2];
$rec ++;
if ( $rec == $recCount ) {
and its that easy!
it took me a minute to figure out; but all I had to do was:
if (is_resource($process)) {
for ($i = 0; $i sizeof($src_ip); $i++) {
fwrite($pipes[0], $sig_desc[$i],$src_ip[$i],$dst_ip[$i]\n);
}
fclose($pipes[0]);
fclose($pipes[1]);
with exec() I wouldnt assume that all the PATH info is there, just to be
sure, use hardcoded paths.
exec(/usr/bin/mysqldump /tmp/somesql.txt, $return);
print_r($return);
--
Chris Lee
[EMAIL PROTECTED]
Christian Dechery [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL
$cmd=mysqldump .. somefile.sql;
if( !fopen(somefile.sql,r) ) { print error message };
$cmd is correct... I've copy-pasted it tons of times in the command shell
Were you the nobody user when you did that? It really doesn't count for
much if you weren't, cuz PHP runs as nobody -- or
4 matches
Mail list logo