【发布时间】:2017-03-08 06:50:34
【问题描述】:
我是 MYSQL 的新手,我正在尝试将我的数据库导出为 html,并将数据放入特定的 html 表中。我环顾了该网站,但我的代码无法正常工作,有人可以帮助我,并告诉我这段代码是否正确吗?
<?php
$con=mysqli_connect("xxx","xxx","xxx","xxx","xxx");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM xxx");
while($row = mysqli_fetch_array($result))
{
<tr>
<th bgcolor="#3281c6">" . $row["PO_nummer"]. "</th>
<th bgcolor="#3281c6">" . $row["Varenummer"]. "</th>
<th bgcolor="#3281c6">" . $row["Produkt_beskrivelse_"]. "</th>
<th bgcolor="#3281c6">" . $row["Antal"]. "</th>
}
mysqli_close($con);
?>
【问题讨论】:
-
有什么问题(异常/不正确的 UI 渲染等),突出显示不会迫使这里的人假设您的问题。
-
用引号或在 stackoverflow.com/questions/18140270/…