zoukankan      html  css  js  c++  java
  • SQL语句关联查询

    <?php
            //获取数据库中的所有留言
               require_once("connect.php");
               //执行数据库查询
               $sql="select msgs.id,msgs.title,users.name,msgs.time from msgs,users where users.id = msgs.authord";
               $results = mysqli_query($link,$sql);
               //处理查询结果
               while($row = mysqli_fetch_assoc($results)){
                   echo "<table border='1'>";
                   echo "<tr>";
                   echo "<td>" . $row["id"] . "</td>";
                echo "<td>" . $row['title'] . "</td>";
                echo "<td>" . $row['name'] . "</td>";
                echo "<td>" . $row['time'] . "</td>";
                echo "<td>"."<a href='deleteMsg.php'>"."添加"."</a>"."<a href='deleteMsg.php'>"."删除"."</a>"."</td>";
                echo "</tr>";
                echo "</table>";
               };    
            //关闭数据库连接
               mysqli_close($link);
        ?>

  • 相关阅读:
    岳麓山岳麓书院
    花洲书院
    《诫子书》诸葛亮
    AI ML DL
    台湾大学林轩田机器学习基石
    LeNet
    VGGNet
    AlexNet 2012
    AS 中 Plugin for Gradle 和 Gradle 之间的版本对应关系
    AndroidStudio、gradle、buildToolsVersion关系
  • 原文地址:https://www.cnblogs.com/wangshengli520/p/9913844.html
Copyright © 2011-2022 走看看