<?php
    $con = mysql_connect("localhost:3306","root","");

    if (!$con) {
        die('Could not connect: ' . mysql_error());
    }

    mysql_select_db("test", $con);

    $result = mysql_query("SELECT * FROM user");

    echo "<table border='1'>
    <tr>
    <th>Username</th>
    <th>Password</th>
    </tr>";

    while($row = mysql_fetch_array($result)) {
        echo "<tr>";
        echo "<td>" . $row['username'] . "</td>";
        echo "<td>" . $row['password'] . "</td>";
        echo "</tr>";
    }
    echo "</table>";

    mysql_close($con);

?>
从服务器中获取用户所有信息(SQL SELECT语句)并以表格形式出现

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-27
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2022-01-19
  • 2022-01-22
猜你喜欢
  • 2021-09-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2022-01-22
  • 2021-08-12
相关资源
相似解决方案