Tell me, please, that’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 make a page that matches the selected item?

    1 answer 1

    It is possible to output 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>"; } } 

    But what do you mean by "point"?

    • There are sections and subsections. The same points and subparagraphs. And what is written paragraph, this is the sub. $w = "select * from razdel where tema_num_tema={$row['num_tema']}"; This line is responsible for the selection of sub-items, which will be the active links. On the click of which the page was displayed. It is just not clear where to write the code? In the same file as the menu? And how to "glue" it with the main page? - new_russian_man