I'm having trouble writing to two different fields of a table using a <select>
that has two attributes name and <options>
with two value . >
I used the following code, but it only recorded the first name with its value:
<div align="center" style=" padding:2px; border-right:solid 1px;float:left; width:210px; height:auto; float:left;">
<?php
include '../conexao.php';
$codigo = $_POST['codigo'];
$noticia = $_POST['noticia'];
$habi_noticia = $_POST['habi_noticia'];
$query = mysql_query("SELECT * FROM menu");
$res = mysql_fetch_array($query);
if(isset($_POST['noti'])){
$noticia = $_POST['noticia'];
$habi_noticia = $_POST['habi_noticia'];
$update = mysql_query("UPDATE menu SET noticia = '$noticia', habi_noticia = '$habi_noticia'");
if($update == ''){
echo "
<script language='javascript'>
window.alert('Erro ao Habilitar Link Noticias!');
</script>";
} else{
echo "
<meta http-equiv='refresh' content='0; URL= menu_halitar_link.php'>
<script language='javascript'>
window.alert('Link Noticias Habilitado com sucesso!');
</script>";
}
}
?>
<form name="noti" action="" method="POST" enctype="multipart/form-data">
<label>Habilitar o Link Noticias?</label><br /><br />
<select name="noticia" | name="habi_noticia" >
<option value='<li><a href="<?php echo $res['dominio'];?>noticias.php" class="nav1">Noticias</a></li><li class="divider"></li>' | value='Sim'>Sim</option>
<option value="" | value="Não">Não</option>
</select><input type="submit" name="noti" value="Atualizar" />
</form>
</div>
Is it possible to write two values in different fields using Select? if so, how?