0
I wish I could understand a problem I have here. I created a static list/ menu, but I need to leave marked option saved in the bank, when I have a table that allows me the relationship I do cool, 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 *state_civil* there I check if the $estadocivil
is the same as the one in the bank and I leave the option selected, but in my problem is that I don’t have a table that allows me this interaction.
I created a List/Menu with static options and would like to know how to mark the option that is in the database.
What I got 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>
On the bench I have recorded in the field nivel_ingles
the option "Intermediary", would someone help me or give me some hint on how to do?
Thank you and be at peace.
Hello "rocmartins". Thank you very much for the help, I was having problems accentuating, I appreciate the help.
– adventistapr