Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/02/2012, 10:04
elVistoko
 
Fecha de Ingreso: enero-2010
Mensajes: 18
Antigüedad: 14 años, 3 meses
Puntos: 0
problema enviar dato combobox con datos mysql

Buenas, tengo un problema cuando selecciono un dato de un combobox que lleno de una columna desde una tabla de mysql, lo envio hacia otro archivo php donde me muestre toda la informacion de la fila de la tabla en la base de datos, pero me tira un error en las lineas 2 y 46 del 2° php, entonces no se que pueda ser y si alguien me puede ayudar se lo agradeceria.

aca dejo el codigo del 1° php que toma los datos y los deja en el combobox

<?PHP
mysql_connect("localhost", "root", "") or die(mysql_error());//conexion a la base de datos
mysql_select_db("preproyecto") or die(mysql_error());
$query="SELECT nombre FROM vina ORDER BY numero asc";//genera consulta para la columna nombre
$result = mysql_query ($query);
echo "<form method='post' name='form1' action='recibe.php'>";//form donde se muestra el combobox
echo "<select name='nombre_cnl'>";
echo "<option value'0'>Nombre Canal</option>";
while($nt=mysql_fetch_array($result)){//Arreglo guarda los datos en la variable $nt
echo '<option value="'.$nt['nombre'].'">'.$nt['nombre'].'</option>';
}
echo "</select>";
echo "<input type='Submit' name='Submit' Value='Enviar' />";
echo "</form>";
?>

este es el código del 2° php que se llama recibe.php

<?php
$canal = $_POST['nt'];

mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("preproyecto") or die(mysql_error());
$query= "SELECT * FROM vina WHERE nombre=$canal";
$result = mysql_query ($query);

echo "<table border='1' STYLE='font-size:15px' id='datos'>";// Se crean los nombres de los campos de la tabla
echo "<thead>";
echo "<tr>";
echo "<td align='center'><b><u>N&uacute;mero</u></b></td>";
echo "<td align='center'><b><u>Nombre</u></b></td>";
echo "<td align='center'><b><u>Recepci&oacute;n</u></b></td>";
echo "<td align='center'><b><u>Codificaci&oacute;n</u></b></td>";
echo "<td align='center'><b><u>Conexi&oacute;n</u></b></td>";
echo "<td align='center'><b><u>Publicidad</u></b></td>";
echo "<td align='center'><b><u>Doble_Fuente</u></b></td>";
echo "<td align='center'><b><u>Receptor_Actual</u></b></td>";
echo "<td align='center'><b><u>Sat&eacute;lite</u></b></td>";
echo "<td align='center'><b><u>Polaridad</u></b></td>";
echo "<td align='center'><b><u>Unicaci&oacute;n</u></b></td>";
echo "<td align='center'><b><u>Unit_Rack</u></b></td>";
echo "<td align='center'><b><u>TMX</u></b></td>";
echo "<td align='center'><b><u>RIM</u></b></td>";
echo "<td align='center'><b><u>ASI</u></b></td>";
echo "<td align='center'><b><u>Mpeg</u></b></td>";
echo "<td align='center'><b><u>Resoluci&oacute;n</u></b></td>";
echo "<td align='center'><b><u>BW_Video</u></b></td>";
echo "<td align='center'><b><u>BW_Audio_1</u></b></td>";
echo "<td align='center'><b><u>Descriptor_A1</u></b></td>";
echo "<td align='center'><b><u>BW_Audio_2</u></b></td>";
echo "<td align='center'><b><u>Descriptor_A2</u></b></td>";
echo "<td align='center'><b><u>Versi&oacute;n_FW</u></b></td>";
echo "<td align='center'><b><u>Direcci&oacute;n</u></b></td>";
echo "<td align='center'><b><u>Mask</u></b></td>";
echo "<td align='center'><b><u>Gateway</u></b></td>";
echo "</tr>";
echo "</thead>";

while ($row = mysql_fetch_array($result)){ //se crea el while para ingresar los datos
//a la tabla segun los que existan en la tabla
echo "<tr><td align='center'>";
echo $row['numero'];
echo "</td><td align='center'>";
echo $row['nombre'];
echo "</td><td align='center'>";
echo $row['recepcion'];
echo "</td><td align='center'>";
echo $row['codificacion'];
echo "</td><td align='center'>";
echo $row['conexion'];
echo "</td><td align='center'>";
echo $row['publicidad'];
echo "</td><td align='center'>";
echo $row['doble_fuente'];
echo "</td><td align='center'>";
echo $row['receptor_actual'];
echo "</td><td align='center'>";
echo $row['satelite'];
echo "</td><td align='center'>";
echo $row['polaridad'];
echo "</td><td align='center'>";
echo $row['ubicacion'];
echo "</td><td align='center'>";
echo $row['unit_rack'];
echo "</td><td align='center'>";
echo $row['tmx'];
echo "</td><td align='center'>";
echo $row['rim'];
echo "</td><td align='center'>";
echo $row['asi'];
echo "</td><td align='center'>";
echo $row['mpeg'];
echo "</td><td align='center'>";
echo $row['resolucion'];
echo "</td><td align='center'>";
echo $row['bw_video'];
echo "</td><td align='center'>";
echo $row['bw_audio_1'];
echo "</td><td align='center'>";
echo $row['descriptor_a1'];
echo "</td><td align='center'>";
echo $row['bw_audio_2'];
echo "</td><td align='center'>";
echo $row['descriptor_a2'];
echo "</td><td align='center'>";
echo $row['version_fw'];
echo "</td><td align='center'>";
echo $row['direccion'];
echo "</td><td align='center'>";
echo $row['mask'];
echo "</td><td align='center'>";
echo $row['gateway'];
echo "</td></tr>";
}
?>


Saludos