Hi Srinivas,
Try with this..
$query="select * INTO OUTFILE 'write_2_file' from counter where wo = '$wo'";
if (!mysql_query($query,$dbLink))
{
DisplayErrMsg(sprintf("Error in executing %s stmt", $stmt)) ;
DisplayErrMsg(sprintf("error:%d %s", mysql_errno($dbLink), mysql_error($dbLink))) ;
exit() ;
}
else
{
print "Your file has been created..";
exit();
}
..where $dbLink is your db_connection Handler..
function DisplayErrMsg( $message )
{
printf("<blockquote><blockquote><blockquote><h3><font color=\"#cc0000\">
%s</font></h3></blockquote></blockquote></blockquote>\n", $message);
}
--Shastry