Estou com dificuldade em gravar em dois campos diferentes de uma tabela utilizando um <select>
que possui dois atributos name e <options>
com dois value.
Utilizei o código abaixo, porém o mesmo gravou somente o primeiro name com seu respectivo 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>
É possível gravar dois valores em campos diferentes usando o Select? caso sim, como?