PHP Select Option MYSQL

1

I have a page where the person adds values from the Database.

<?php   
    $get = ("SELECT movie_id, movie_name FROM movies ORDER BY movie_name DESC");
    $result2 = mysqli_query($con, $get);

    $option = '';

    while($row = mysqli_fetch_array($result2))
    { 
      $option .= "<option value = '".$row['movie_id']."'>".$row['movie_name']."</option>";
    }
?>           

<form action="includes/reload.php" method='POST'>
    <select name="selectionD" id="fname">         
        <?php
            echo "<option value='0'>Escolha a Serie...</option>";
            echo "<option value='0'></option>";
            echo $option;
        ?>        
    </select>          

   <input type="text" class='' id="fname" name="sess" maxlength='3' placeholder="Nº Temporada" required>
   <input type="hidden" value='' name="movid"  hidden>
   <input type="text" id="fname" name="episode" maxlength='3' placeholder="Nº Episódio" required>

    <br/>
    <input type="submit" value="Adicionar" name='saveNew'>
</form> 

The result of this is to add records in the Database with the values $ movie_id, session and episode ...

But I also wanted to add the name of the episode, as you see in < .Option. > Name .. $ row ['movie_name'] ... I only get polo as text ...

Is there any way to add the name of the movie together with the option chosen in OPTION?

Example .. If I choose Option 1, it gives me the desired Value of the DB, but not with me to make it also save the NAME.

    
asked by anonymous 18.08.2017 / 18:27

0 answers