The answer to the first question is no. That's considered a security no no.
The answer to the second question is this,
dump your table to a file. This is pretty easily done if you are just wanting to dump the file, or if you are wanting a csv file or just about anything else.
Here's an example:
$query = "SELECT author,title,isbn FROM authors,books WHERE author='4'";
$result = mysql_query($query);
$temp_file = "6346272729.txt";
$fp = fopen($temp_file,"w");
while(list($author,$title,$isbn) = mysql_fetch_array($result)) {
fwrite($fp,"$author,$title,$isbn"); // this is pretty much a csv file
}
fclose($fp);
header("Location: sendtoclient.php?file=$temp_file");
sendtoclient.php
header("Content-Type: text/plain");
header("attached: $file");
You may want to check on the header("attached" line... I'm not sure that is correct, but if I am correct this will initiate a download of your temp_file that you created on the previous script so that the user is prompted to download the file like any other download.
You can then add some clean up code that destroys the file once they are done.