我認爲問題標題不太準確,但這裏是我正面臨的問題的詳細信息。 我有電影數據庫在Oracle10g 我已經包括一個選項供用戶在數據庫中按標題搜索電影。 我用這一段代碼顯示Retured行...從數據庫中獲取行並將它們鏈接到其他頁面
<h1>Search Results</h1>
<table border = "1px">
<thead>
<tr>
<th>ID</th>
<th>RATING</th>
<th>Title</th>
<th>Description</th>
<th>Category</th>
<td>Duration</td>
<td>Actor</td>
</tr>
</thead>
<tbody>
<?php
$search = $_POST['search'];
$search = sanitize($search);
$search = '%'.$search.'%';
$conn = oci_connect("asim","asim","localhost/xe");
$stid = oci_parse($conn,"SELECT
film.film_id AS FID,
film.title AS title,
film.description AS description,
category.name AS category,
film.duration AS length,
film.rating AS rating,
CONCAT (actor.first_name ,CONCAT(' ', actor.last_name)) AS actors
FROM category
LEFT JOIN film_category ON category.category_id = film_category.category_id
LEFT JOIN film ON film_category.film_id = film.film_id
JOIN film_actor ON film.film_id = film_actor.film_id
JOIN actor ON film_actor.actor_id = actor.actor_id
WHERE title LIKE '".$search."'");
oci_execute($stid);
while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
print "<tr>\n";
foreach ($row as $item) {
print " <td>" . ($item !== null ? htmlentities($item, ENT_QUOTES) : " ") . "</td>\n";
}
print "</tr>\n";
}
?>
</tbody>
</table>
我正在以表格形式顯示的結果! 現在我想要的是讓每部電影的標題或film_id都被鏈接起來。 ,並且點擊時它應該導航到該電影的特定頁面。 該頁面可能類似於index.php?id = 1337 並且在索引頁面$ _GET ['userid']可用於獲取關於該電影的信息 主要問題是製作film_id或標題或整個排一個鏈接 我試過使用標籤,但沒有成功。 我是PHP和oracle的新手。 任何形式的幫助將不勝感激。
更新了我的答案,以包含錨鏈接生成示例。 –