誰でも助けることができますか?
ばかげている場合は申し訳ありませんが、私はこれに非常に慣れていないため、自分が何をしているのか本当にわかりません...
php を使用して mysql データベースからデータを取得するテーブルを生成しましたが、(すべての行の) 最後にリンクを含む追加の列を配置したいと考えています。リンクは、そのエントリの詳細へのリンクになります。
テーブルを表示するコードは次のとおりです。
$result = mysql_query("SELECT * FROM orders");
echo "<table border='5'>
<tr>
<th>order_no</th>
<th>ord_date</th>
<th>est_completion_date</th>
<th>status</th>
<th>invoice_date</th>
<th>inv_amount</th>
<th>name</th>
<th>fName</th>
<th>lName</th>
</tr>";
// -- Use 'while' to check each row in $result in turn:
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['order_no'] . "</td>";
echo "<td>" . $row['ord_date'] . "</td>";
echo "<td>" . $row['est_completion_date'] . "</td>";
echo "<td>" . $row['status'] . "</td>";
echo "<td>" . $row['invoice_date'] . "</td>";
echo "<td>" . $row['inv_amount'] . "</td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['fName'] . "</td>";
echo "<td>" . $row['lName'] . "</td>";
echo "</tr>";
}
echo "</table>";
何度も言いますが初心者です。基本的に、(上記のコードを使用して) mysql クエリの結果を表示する html テーブルを作成することにかなり満足しています。ただし、他のテーブルにリンクするには、ユーザーが行/セルをクリックできるようにする必要があります。
どんな助けでも大歓迎です...