Working with the menu

Tell me, please, here’s what. There is a site menu. Code:

<?php
error_reporting(E_ALL);
mysql_connect("localhost", "root", "");
mysql_select_db("BD");
$q = 'select * from tema';
$r = mysql_query($q);
while ($row = mysql_fetch_array($r)) {
    echo "{$row['naz_tema']}<p>";
    $w = "select * from razdel where tema_num_tema={$row['num_tema']}";
    $e = mysql_query($w);
    while ($row1 = mysql_fetch_array($e)) {
        echo " <p>{$row1['naz_razdel']}<p>";
    }
}
?>

Now how to click on one of the items to show the page that corresponds to the selected item?


Answer 1, authority 100%

It is possible to display data from the database using a unique key. For example by ID

$sql = (isset($_GET['id'])) ? "where `id` = '".intval($_GET['id'])."' " : "";
$q = 'select * from tema '.$sql;
$r = mysql_query($q);
while ($row = mysql_fetch_array($r)) {
    echo "{$row['naz_tema']}<p>";
    $w = "select * from razdel where tema_num_tema={$row['num_tema']}";
    $e = mysql_query($w);
    while ($row1 = mysql_fetch_array($e)) {
        echo " <p>{$row1['naz_razdel']}<p>";
    }
}

Just what do you mean by “point”?