file1.php と file1.php があります。file1.php から file2.php への ID (データベースに格納されている) が必要ですが、2 番目のページにリンクし<a href=
ます。だからSESSIONS
おそらくしないだろう。で試してみましたSESSIONS
が、テストしたときに1つのID番号しか覚えていません。
これは file1.php の行です。
while ($thread = mysqli_fetch_assoc($sql_result)) {
<a href="thread.php?thread_id={$thread['thread_id']}"> {$thread['title']} </a>
}
このwhileループにより、データベース内のすべての異なるタイトルが、thread_idに属する必要な情報を含む(file2.phpへの)リンクを確実に取得します。(thread_id は、他のデータベースと異なる必要があるデータベース内の唯一のものです)
だから今それをfile2.phpで表示するために、私はこれを得ました:
$sql_result = $mysqli2->query("SELECT * FROM questions WHERE thread_id = '".The ID Number of the link of file1.php."'");
while ($thread = mysqli_fetch_assoc($sql_result)) {
echo <<<EOT
<table>
<tr>
<tr><td> {$thread['title']}</td></tr>
<tr><td> {$thread['description']}</td></tr>
<tr><td> {$thread['username']}</td></tr>
<tr><td> {$thread['date_made']}</td></tr>
</tr>
</table>
EOT;
thread_id に属する情報を表示します。どうすればいいですか?