0
我該如何將css應用到$row["name"]
並將其顯示在表格中?
這裏是我的代碼:php數據庫顯示在網頁
<div class="maincontent1">
<?php
$link = mysqli_connect("localhost","root","","webpage2") or die("Error " . mysqli_error($link));
$sql = "SELECT id, name, description1 FROM table1";
$result = $link->query($sql);
if ($result->num_rows > 0)
{
// output data of each row
while($row = $result->fetch_assoc())
{
?>
<div class="title-style1">
<?php
echo $row["name"];
?>
</div>
<?php
echo $row["description1"];
}
$link->close();
}
?>
*如何給css $ row [「name」] * - 什麼'css'?要在'table'中打印它們,只需要相應地替換'div'。 –
請解釋你需要什麼輸出。 –