holas amigos forosdelweb, quiero su ayuda porfavor tengo el problema que ingresan lo id y no los nombres alguien podria ayudarme
Código PHP:
[
<?php
session_start();
mysql_connect("localhost","root","telesup") or die("No se puede conectar");
mysql_select_db("madi") or die ("No se ha podido seleccionar la Base de Datos");
//Recuperacion de las variables convertidas en sesiones
$mercaderista=$_SESSION['mercaderista2']=@$_REQUEST['mercaderista'];
//QUERY COMBO 1
$query="select * from mercaderista";
$res=mysql_query($query);
//Consultas para imprimir los resultados en la ultima parte del programa
$selectS="select nombre_mercaderista from mercaderista where id_mercaderista=$mercaderista";
$resS2=mysql_query($selectS);
$rowS2=@mysql_fetch_assoc($resS2);
?>
<TR>
<TD width="155">mercaderista</TD>
<TD width="158"zz><select name="mercaderista" onchange="this.form.submit()" style="width: 270px" >
<option value="<?php echo $mercaderista?>" >
<?php echo $rowS2['nombre_mercaderista']?>
</option>
<?php while($row=mysql_fetch_array($res)){?>
<option value="<?php echo $row['id_mercaderista']?>">
<?php echo htmlentities($row['nombre_mercaderista']);?>
</option>
<?php }?>
</select></TD>
</TR>
<?php
mysql_connect('localhost','root','telesup') ;
mysql_select_db('madi') or die(mysql_error());
if (@$_POST['guardar'])
{
mysql_query("insert into reporte(
mercaderista,
values
(
'$mercaderista2',
)");
}
?>