rickywu4 2022-10-09 21:48 采纳率: 100%
浏览 17
已结题

无法通过php用HTML文件显示mysql中表格的数据

无法通过php用HTML文件显示mysql中表格的数据
        <div class="border comMap">
            <section class="history"> </section>
<!DOCTYPE html>
<html lang="en">
<head>
        <meta charset="utf-8">
        <title>Cyclist's Adventure</title>
        <link rel="stylesheet" href="css/style.css">
    </head>
    <body>
        <section class ="history">
            <?php
                $proflie= mysqli_connect("localhost","dbExample","deco18007180","webpage_data")
                $sql= "SELECT * FROM 'trail'";
                $result = mysqli_query($proflie, $sql)
                while ($row = mysqli_fetch_assoc($result)) {
                    echo "
                    <section class='history'>
                        <h3>'.$row['trail_id'].'<h3><br>
                        <h3>'.$row['map_plug'].'<h3><br>
                    </section>";
                }
            ?>
        </section>
    </body>
</html>
上面是我的html文件 下面是我的php文件 我想要在section history里面输出php得到mysql中的数据 我确认过mysql的目录和用户都是正确的。

但是结果为空。

  • 写回答

2条回答 默认 最新

  • CSDN-Ada助手 CSDN-AI 官方账号 2022-10-09 22:27
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 10月24日
  • 已采纳回答 10月16日
  • 修改了问题 10月9日
  • 修改了问题 10月9日
  • 展开全部