0
我是新來的MYSQL,我想導出我的數據庫到HTML,並把數據放到特定的HTML表格。我瀏覽過網站,但我不能讓我的代碼工作,有人可以幫我,並告訴我,如果這段代碼看起來是正確的?從MYSQL導出到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);
?>
什麼是我ssue(異常/不正確的UI渲染等),突出顯示不會強迫人們假設你的問題。 – Anil
重複問題:http://stackoverflow.com/questions/17902483/show-values-from-a-mysql-database-table-inside-a-html-table-in-a-page/17902527#17902527 –
這是一個好的開始寫你的HTML和PHP的報價,或外部<?php標籤。檢查如何做到這一點:http://stackoverflow.com/questions/18140270/how-to-write-html-code-inside-php – Finduilas