Home > Article > Backend Development > 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 |
{$rel['id']} | {$rel['name']} |