您好,欢迎访问一九零五行业门户网

php后台查出数据,输出在html表格里,如何做

php后台查出数据,输出在html表格里,怎么做
php后台查出数据,输出在html表格里。后台b.php,前台a.html。查出的数据是$result,里面有id,name。怎么做?
------解决思路----------------------
b.php:
$con=mysqli_connect('localhost','root','root','test'); //用户名和密码请自己修改
$a=mysqli_query($con,'select * from a'); //表名自己修改
$html=id name
;
while($rel=mysqli_fetch_assoc($a)){
$html=$html.{$rel['id']} {$rel['name']}
;
}
$html.'
';
file_put_contents('a.html',$html);

------解决思路----------------------
请使用模板技术
其它类似信息

推荐信息