【发布时间】:2013-11-21 01:05:21
【问题描述】:
如果数据库的 PR 行中有值,如何禁用 href link?就像我下面的示例表一样,如果有 PR 禁用链接。
表格
item_name | PR | < Add > |
ballpen | pr100 | <a> |
pencil | | <a> |
Paper | | <a> |
Clip | | <a> |
代码,
<?php
echo '<table>
<thead>
<tr>
<th></th>
<th>Item Name</th>
<th>PR</th>
<th><Add></th>
</tr>
</thead>';
echo '<tbody>';
$i = 1;
while ($row = $result1->fetch_assoc()) {
if ($row['app_cn'] != '') {
echo '<tr>
<td>' . $i++ . '</td>
<td>' . $row['item_name'] . '</td>
<td>' . $row['pr'] . '</td>
<td align="center"><a class="fancybox" href="addpr.php?counts=' . $row["id"] . '"></a></td>
</tr>';
}
?>
如果行中有 PR,我想禁用圆珠笔行 <a class="fancybox" href="addpr.php?counts=' . $row["id"] . '"></a>
【问题讨论】:
-
你说的禁用是什么意思?
标签: javascript php jquery mysqli