$string ="";
$data = mysql_query("SELECT * FROM metrep");
$datarows = mysql_num_rows($data);
if($datarows > 0)
while($entries = mysql_fetch_array($data)) {
$string .= $entries['your_table_name'];
}
Then you can write the data on a file using
$fp = fopen('myfile.txt','w');
fwrite($fp, implode('\n',$string));
fclose($fp);
Simple???
Just experiment around.
Alex