b.php:
$con=mysqli_connect('localhost','root','root','test');  //用户名和密码请自己修改
$a=mysqli_query($con,'select * from a');                  //表名自己修改
$html="<table border='1' width='100'><tr><td>id</td><td>name</td></tr>";
while($rel=mysqli_fetch_assoc($a)){
    $html=$html."<tr><td>{$rel['id']}</td><td>{$rel['name']}</td></tr>";
}
$html.'</table>';
file_put_contents('a.html',$html);