gpt4 book ai didi

php - 表格未显示在 HTML 数据库中

转载 作者:行者123 更新时间:2023-11-29 13:23:09 24 4
gpt4 key购买 nike

我正在创建一个数据库,在创建 HTML 脚本时,表格返回时没有边框 = Firstname Lastname ";

while($row = mysqli_fetch_array($result)) { 
echo "";
echo "" . $row['Firstname'] . "";
echo "" . $row['Lastname'] . "";
echo "";
}
echo "";
mysqli_close($con); ?>

这是我创建的代码,有人可以查看它并告诉我我做错了什么吗?

<?php
$con=mysqli_connect("localhost","root","","Franchise_Call_Log");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

$result = mysqli_query($con,"SELECT * FROM caller_info");

echo "<table border='1'>
<tr>
<th>Firstname</th>
<th>Lastname</th>
th>Franchise</th>
</tr>";

while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['Firstname'] . "</td>";
echo "<td>" . $row['Lastname'] . "</td>";
echo "<td>" . $row['Franchise'] . "</td>";
echo "</tr>";
}
echo "</table>";

mysqli_close($con);
?>

最佳答案

查看标签

<th>Franchise</th>

关于php - 表格未显示在 HTML 数据库中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20511006/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com