How to make drop down list in php, data from mysql

How to make a drop-down list next to the field to fill in, which will show data from another table and, when clicked, write them to the field?

<form method="kolstud" action="kolstud.php">
<input name="namebook" ty0="int" value=" "/>
  <input name="FIOstud" type="int" value=" "/>
  <input type="submit" name="Submit2" value=""/>
$namebook = $_REQUEST['namebook'];
$FIOstud = $_REQUEST['FIOstud'];
$insert = "INSERT INTO `kolstud` VALUES (
  ( SELECT `idbook` FROM `book` WHERE `name` = '$namebook' ),
  ( SELECT `idstudent` FROM `student` WHERE `FIO` = '$FIOstud' )

Answer 1

<select name="book">
    <option value="0"> </option>
$res = mysql_query('select `id`, `name` from `books`');
while($row = mysql_fetch_assoc($res)){
    <option value="<?=$row['id']?>"><?=$row['name']?></option>

Like this. Why do you have input type=”int”?
And if you want to make a button like in Joomla, use css to place a text field above the select so that only the arrow sticks out.

Changed the code.