connect_error); } $sql = "SELECT location-6ren">
gpt4 book ai didi

php - 在php上显示数据

转载 作者:行者123 更新时间:2023-11-29 18:02:08 25 4
gpt4 key购买 nike

>

</tr>
<?php
$conn = mysqli_connect("localhost", "root", "", "engine");
if ($conn-> connect_error) {

die("connection files:" . $conn-> connect_error);
}

$sql = "SELECT location , brand, model, origin, mfgdate from engines ";
$result = $conn-> query($sql);

if ($result-> num_rows > 0){
while ($row = $result-> fetch_assoc()){
echo "<tr><td>".
$row["location"] . "</td<td>" .
$row["brand"] . "</td><td>".
$row["model"] . "</td><td>".
$row["origin"] . "</td><td>".
$row["mfgdate"] . "</td></tr>";
}
echo "</table>";
}
else{
echo "0 result";
}
$conn->close();
?>



</table>

when code is execute

实际上“test”=位置test1=品牌test2=型号test3=原产地和输入日期为=mfgdate

请帮我安排 table

最佳答案

而不是

$row["location"] . "</td<td>" 

使用

$row["location"] . "</td><td>"

(标记中缺少结尾 >)。

关于php - 在php上显示数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48251370/

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