【发布时间】:2010-10-31 01:03:12
【问题描述】:
我有以下代码:
<table>
<thead>
<tr>
<th>Service</th>
<th>Status</th>
</tr>
</thead>
<?php $result = mysql_query("SELECT Service, Status FROM services WHERE Company='Company 1'");
while ($row = mysql_fetch_array($result)) {
// ^ must be a single '=' !!!!
echo '<tr><td>' . $row["Service"] . '</td>';
echo '<td>' . $row["Status"] . '</td></tr>';
} ?>
</table>
在 HTML 表中显示 MySQL 数据库中的多行。我的问题是.. 我如何确定是否没有符合我的条件的行,并显示一条消息表明它是空的?
【问题讨论】:
标签: php html mysql html-table