I wish I could understand a problem I have here. I created a static list / menu, but I need to leave marked option recorded in the database, when I have a table that allows me the relationship I make legal, as in this case:
<?php
mysql_select_db($database_conCurriculo, $conCurriculo);
$QueryEstado = "SELECT * FROM estado_civil";
$EstadoCivil = mysql_query($QueryEstado, $conCurriculo) or die(mysql_error());
while ($row_EstadoCivil = mysql_fetch_assoc($EstadoCivil)) {
echo "<option value='".$row_EstadoCivil["id"]."'";
if ($estadocivil == $row_EstadoCivil["id"]) {
echo "selected";
}
echo ">".$row_EstadoCivil["estado"]."</option>\n";
}
?>
In the above case I have the table * civil_status * I check if the $estadocivil
is equal to what is in the database and leave the option selected, but my problem is that I do not have a table that allows me this interaction.
I created a List / Menu with the static options and would like to know how to mark the option that is in the bank.
What I have is this:
<select name="nivelingles" id="nivelingles">
<option value="0" selected="selected">Selecione</option>
<option value="Básico">Básico</option>
<option value="Intermediário">Intermediário</option>
<option value="Avançado">Avançado</option>
</select>
In the database I have written in the nivel_ingles
field the "Intermediate" option, could anyone help me or give me some tips on how to do it?
Thanks and stay in peace.