このようなトピックをいくつか見たので、最初に申し訳ありませんが、これらのトピックに記載されている解決策のどれも私の問題を解決しませんでした.
PHP と mysql を使用してダイナミック ナビゲーション メニューを作成しようとしています。データベースにダミー テキストとして複数の入力がありますが、何らかの理由で 1 つの結果のみを表示したい..
これが私のコードです:
<?php
require_once("../includes/connect.php");
include("../includes/header.php");
include("../includes/functions.php");
?>
<div id="content">
<table id="table">
<tr>
<td id="nav">
<ul class="info">
<?php
$result = mysql_query("SELECT * FROM information LIMIT 10", $connection);
while ($row = mysql_fetch_assoc($result)){
echo "<li>{$row["menu"]}</li>";
$result = mysql_query("SELECT * FROM pages WHERE information_id ={$row["id"]} LIMIT 10", $connection);
echo "<ul class=\"pages\">";
while ($row = mysql_fetch_assoc($result)){
echo "<li>{$row["menu"]}</li>";
}
echo "</ul>";
}
?>
</ul>
</td>
<td id="main">
<h2>Main Content</h2>
</td>
</tr>
</table>
</div>
<?php
include("../includes/footer.php");
?>
</body>
</html>
ここにテーブルがあるので嫌いにならないでください笑、公共の使用のためのものではありません。すべてをセットアップして機能させたら、グリッドに変換します。私は「プロ」の php プログラマーではないので、よろしくお願いします。