There is a site that makes drop-down menus from the database and displays the desired name under the desired id, how to make so that instead of the drop-down menu there are, so to speak, links to each object from the database, and next to some description (a picture, for example, or take a picture make it as a link) and so that the number of objects was no more than 5 per page. Many pages are not an option because of objects> 500

echo '<input type="text" id="selectFilter" placeholder="Введи текст для поиска" />'; echo "<form method='post' action='obj.php'><select name='id' id='filterableSelect'>"; $sql = mysql_query("select * from `obj` order by `id`"); for ($i = 1; $i <= mysql_num_rows($sql); $i++) { while($s=mysql_fetch_array($sql)) { echo "<option value='".$s['id']."'>".$s['name']."</option>"; } $sec = $s['id']; echo "<br>"; } echo "</select><input type='submit' name='action' value='Выбрать Obj файл'></form>"; 

Site

  • Well, apparently, instead of the points of the dropout (echo '<option ....>') display links (echo '<a href="..."> ... </a>'). what is the difficulty? - AlexandrX
  • @AlexandrX I understand, but I do not know how to make a picture from the database with the selected id taken, and by clicking on it, it worked as a link that transmits $ sec = $ s ['id']; and how to make such pictures have 5 on the page, then 5 more and so on - Michael
  • @AlexandrX mb there is no difficulty, I do not know how to implement it, especially the withdrawal of a limited number on page - Michael
  • Well, brother, you asked a difficult question :) to limit - see SELECT .... LIMIT . to display images - see the basics of HTML. Much detail than here mysql.ru/docs/man/SELECT.html and here htmlbook.ru/html/a hardly anyone here will explain :) - AlexandrX

0