Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/12/2008, 09:57
Shinok
 
Fecha de Ingreso: noviembre-2008
Mensajes: 8
Antigüedad: 15 años, 5 meses
Puntos: 0
Mostrar tabla de registro segun la lista desplegable

bueno muchachos yo otra vez jodiendo xD

la pregunta es la siguiente quiero saber como hago para que segun la pcion que escoja en la lista desplegable me muestre una tabla segun la opcion de la lista que escoja

Código PHP:
  <?
    
        $con 
mysql_query("SELECT nom_curso FROM curso ORDER BY id_curso");

        echo 
"<select name=\"inscri\">";
        while(
$row mysql_fetch_array($conMYSQL_ASSOC))
        {
        foreach (
$row as $opt){
        echo 
"<option>$opt \n</option>";
        }
        }

      echo 
"</select>";
?>
<BR/>

 


<br/>
  <table width="590" height="49" border="1" align="center" cellspacing="1" bgcolor="#FFFFFF" frame="box">
    <tr> 
      <th width="79" height="39">Cedula</th>
      <th width="217">Nombre </th>
      <th width="162">Direccion</th>
      <th width="79" height="39">telefono</th>
      <th width="79" height="39">Institucion</th>
      <th width="217">Programa</th>
      <th width="162">Curso</th>
      <th width="79" height="39">correo</th>
    </tr>
    <?
//Ejecutamos la sentencia SQL
$capa=$_POST['inscri'];
$result=mysql_query("SELECT * FROM inscritos  ORDER BY Nombre WHERE Capacitacion=$capa");

//Mostramos los registros
[B]while ($rew=mysql_fetch_array($result))[/B]
{
echo 
'<tr><td>'.$rew["Cedula"].'</td>';
echo 
'<td>'.$rew["Nombre"].'</td>';
echo 
'<td>'.$rew["Direccion"].'</td>';
echo 
'<td>'.$rew["Telefono"].'</td></tr>';
echo 
'<td>'.$rew["Institucion"].'</td></tr>';
echo 
'<td>'.$rew["Programa"].'</td>';
echo 
'<td>'.$rew["Capacitacion"].'</td></tr>';
echo 
'<td>'.$rew["Email"].'</td></tr>';
}
[
B]mysql_free_result($result)[/B]
?>
  </table>

segun me dicen el erroe esta en las lineas que estan resaltadas en negritas alguien me puede hacer el favor de colaborarme a ver como corrijo eso?