难以从<select>获取值

I'm trying to get the user's choice in a <option> tag.
The multiple <option> tags are generated from data from the database.

Here's the form:

    <form action="mudaVideo.php" method="post">

            <label for="sel1">escolher o vídeo</label>
            <select class="form-control" name="apagar">

              <?php

  $sql = "SELECT * FROM video ORDER BY idvideo";
  $result = mysqli_query($conn,$sql) or trigger_error("SQL", E_USER_ERROR);

  while ($list = mysqli_fetch_assoc($result)) {

          $idvideo = $list["idvideo"];
          $titulo = $list["titulo"];
          $subtitulo = $list["subtitulo"];
          $link = $list["link"];

          echo '<option>'.$titulo.'</option>';

  } // end while

               ?>

                <option>wow ate me passo</option> -->
           </select>
        <button type="submit" name="apagar" class="btn btn-primary" id="enviar" style="background-color:transparent; color:black;">apagar vídeo</button>

        </div>
      </form>

Here's my php:

    if(isset($_POST['apagar'])) {


  $id = $_POST['apagar'];

  echo 'a escolha foi ' . $id . '!';

  $sql = "DELETE FROM video
          WHERE idvideo='".$id."'";
$result = mysqli_query($conn, $sql);


 if ($conn->query($sql) === TRUE)

    {

   }

   else

   {
       echo "Error: " . $sql . "<br>" . $conn->error;
   }
}

When I try to echo the value of $id, it's empty, so something wrong is escaping me.

Thanks in advance

You'll need the value attribute in <option>.

For example:

<select name="apagar">
  <option value="1">First</option>
  <option value="2">Second</option>
  <option value="3">Third</option>
</select>

You can solve this by using:

echo '<option value="' . $titulo . '">'.$titulo.'</option>';

Also, both the <button> and <select> have the same name apagar, thus it will have value of the latter as it comes after <select>:

<select class="form-control" name="apagar">

<button type="submit" name="apagar" class="btn btn-primary" id="enviar" style="background-color:transparent; color:black;">apagar vídeo</button>

The problem is you have two form elements with the same name. Your select has the name of apagar but so does your button. Since the button comes after the select, it overrides the name of the select. You also need a value="" with the id of each of your options.