There is a table with monuments and their description, the script below displays all the names of the monuments in the form of links, so that when you click on the link (the name of the monument), a description of the monument that matches the name in the database is displayed
$opisanie= $_POST['opisanie']; $ima_pamytnika= $_POST['ima_pamytnika']; if(isset($_POST["send"])){ if(empty($_POST["opisanie"])) { $error[1] = 'Π²Π²Π΅Π΄ΠΈΡΠ΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ ΡΠΎΡΠΊΠΈ<br>'; } if(empty($_POST["ima_pamytnika"])) { $error[2] = 'Π²Π²Π΅Π΄ΠΈΡΠ΅ ΠΈΠΌΡ ΠΏΠ°ΠΌΡΡΠ½ΠΈΠΊΠ°<br>'; } if(!empty($error)) { foreach($error as $value) { echo 'ΠΡΠΈΠ±ΠΊΠ°:'.$value; } }else{ $sql = "INSERT INTO pamyatniki(opisanie,name) VALUES ('$opisanie','$ima_pamytnika')"; mysql_query($sql) or die(mysql_error()); } } $res=mysql_query("SELECT name FROM pamyatniki ORDER BY id DESC"); while ($r = mysql_fetch_row($res)) { foreach ($r as $k => $d) { echo "ΠΏΠ°ΠΌΡΡΠ½ΠΈΠΊ".' = <a href="">'.$d."</a><br/>"; } } // Π·Π΄Π΅ΡΡ Π½Π΅ ΠΏΠΎΠ»ΡΡΠ°Π΅ΡΡΡ Π²ΡΠ²Π΅ΡΡΠΈ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ if(isset($d)){ $query=mysql_query("SELECT opisanie FROM pamyatniki WHERE name='$ima_pamytnika'"); while($row = mysql_fetch_array($query)) { echo $row['opisanie']; } }