如何使mysql数据阵列可点击

时间:2018-04-04 13:34:11

标签: php mysql arrays database mysqli

我必须从我的MySQL数据库中提取数据,一切顺利,数据以表格的形式显示,这里是代码:

<?php
    $no     = 1;
    $total     = 0;
    while ($row = mysqli_fetch_array($query))
    {
        $category  = $row['category'] == 0 ? '' : number_format($row['category']);
        echo '<tr>
                <td>'.$no.'</td>
                <td>'.$row['id'].'</td>
                <td>'.$row['url'].'</td>
                <td>'. $row['code'] . '</td>
                <td>'.$category.'</td>
            </tr>';
        $total += $row['category'];
        $no++;
    }?>

除了我希望数据&#34;。 $行[&#39; URL&#39;]&#34。 可点击,因为它是一个网址。我尝试了这个没有结果。这没什么显示:

echo '<a href="'.$row['url'].'">'.$row['url'].'</a>';

这也是:

'<td><a href="'.$row['url'].'">'.$row['url'].'</a></td>'

以下是链接:data table

0 个答案:

没有答案