You can simply use below code of you want to save as HTML table, or you can export your data from SQL and then import to your local SQL server.
<?php
ob_start();
?>
<table id="database">
<tr>
<th>Title1</th>
<th>Title2</th>
<th>Title3</th>
<th>Title4</th>
</tr>
<?php
$result = mysql_query("SELECT * FROM `table`");
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>".$row['Column1']."</td>";
echo "<td>".$row['Column2']."</td>";
echo "<td>".$row['Column3']."</td>";
echo "<td>".$row['Column4']."</td>";
echo "</tr>";
}
?>
</table>
<?php
$output = ob_get_contents();
$filename = "column".time().".txt";
file_put_contents($filename, $output) or die("can't write to the file");
?>