Assign list returned from the database to a combobox

0

I have an HTML / PHP code where it has a list field that I would like to return the bank records. However, the field or variable appears in the list display instead of the BD values.

I can not figure out the cause of the problem.

In the image below note that an excerpt of the code "$ line ['state_name'] appears in the list of states."

Hereisthesnippetofcode:

<tdclass="Label">Estado: </td> <!-- Aqui é uma FK -->
    <td class="Field"><select id="slct1" name="estado">
        <?php
            include "connector.php";
            $sql = "SELECT sigla_estado, nome_estado FROM estado;";
            $resultado = mysql_query($sql) or die (mysql_error());
            echo "<option value=''>Selecione</option>";
            while ($linha = mysql_fetch_array($resultado)){
                echo "<option value='".$linha['sigla_estado']."'>".$linha['nome_estado']."</option>";
            }
        ?>
    </select>
</tr>

Below is my connector:

<?php
$Servidor = '*********';
$usuario = '*********';
$senha = '********';
$banco = '************';
mysql_connect($Servidor,$usuario,$senha) or die (mysql_error()) ;
mysql_select_db($banco) or die (mysql_error());
?>
    
asked by anonymous 02.07.2016 / 21:17

0 answers