-1
我有一張錶鏈接到我的mySQL數據庫。如何使mySQL中的url字段顯示爲html表格中的鏈接?
我有一個特定的字段包含一個URL。該網址正確顯示在表格中,但不能用作鏈接。
我可以讓網址顯示爲鏈接嗎?
領域是 「pdf_link」
這裏是我的代碼:
<?php
$db = new mysqli("localhost", "XXXXX", "XXXXXX", "XXXXXXXX");
$query = "SELECT part_no, description, count, size, pdf_link, min, max, current FROM folding_cartons LIMIT 0,50";
$result = $db->query($query, MYSQLI_STORE_RESULT);
$o = '<table id="tablesorter-demo" class="tablesorter" border="0" cellpadding="0"
cellspacing="1"><thead><tr><th>Part Number</th><th>Description</th><th>Count</th>
<th>Size</th><th>PDF Link</th><th>Min</th><th>Max</th><th>Current</th></tr></thead>
<tbody>';
while(list($part_no, $description, $count, $size, $pdf_link, $min, $max, $current) =
$result->fetch_row()) {
$o .= '<tr><td>'.$part_no.'</td><td>'.$description.'</td><td>'.$count.'</td>
<td>'.$size.'</td><td>'.$pdf_link.'</td><td>'.$min.'</td><td>'.$max.'</td>
<td>'.$current.'</td></tr>';
}
$o .= '</tbody></table>';
echo $o;
?>
謝謝你了! – Erik