Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/03/2012, 10:39
Kikix
 
Fecha de Ingreso: febrero-2010
Mensajes: 10
Antigüedad: 14 años, 2 meses
Puntos: 0
Exclamación código buscar e imprimir PHP

hola chicos necesito su ayuda con este código.. aquí yo hago una consulta para buscar en la base de datos, pero al introducir el código pareciera q no recibiera la variable, no encuentro cual es el problema que presenta..

Código HTML:
require ("conectar.php");
		$busca=$_POST['busca'];
		$secion=$_SESSION['busca']=$busca;
		
		$consulta= ibase_query ("SELECT * FROM DOCTOR WHERE CI_COLEGIO='$secion'")or die("No se pudo realizar la consulta a la Base de Datos".ibase_errmsg());
		$resultado=ibase_fetch_assoc($consulta);
		
	?>  
    <table align="center" width="600" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>Registros de Doctores</td>
  </tr>
  <tr>
    <td><table align="center" width="600" border="0" cellspacing="0">
            <tr>
              <td>
              <form id="form1" name="form1" method="post" action="L_Doct.php?bus=$secion">
              <table align="right" width="200" border="0" cellspacing="0" cellpadding="0">
  				<tr>
    			<td>Buscar 
                <input name="busca" type="text" id="busca" value="<?php echo $_SESSION['busca'];?>" size="12" />
                <input type="image" src="../imagenes/Start-Menu-Search-icon.png" width="20" height="20" style="cursor:pointer"/>
                </td>
 			 	</tr>
				</table>
				</form>
              </td>
              </tr>
            <?php 
  	if(isset ($resultado['id']) && $resultado['id']!="")
	{
		?>
	 		<tr>
              <td><table align="center" width="390" border="0" cellspacing="0" cellpadding="0">
  				<tr>
    			<td width="130">Codigo Colegio</td>
   				 <td width="100">Nombre</td>
   				 <td width="100">Apellido</td>
                 <td width="60">Acciones</td>
 				 </tr>
				</table>
			</td>
			
     		
            </tr><?php 
			
			
			
			do{?>
            <tr>
             <td>
             <table align="center" width="390" border="0" cellspacing="0" cellpadding="0">
 			<tr>
    		  <td width="130"><?php echo $resultado['CI_COLEGIO'];?> </td>
              <td width="100"><?php echo $resultado['NOMBRE_D'];?></td>
              <td width="100"><?php echo $resultado['APELLIDO_D'];?></td>
              <td width="30"><a href="M_Doctor.php?id=<?php echo $resultado['id'];?>"><img src="../imagenes/sync-icon.png" width="20" height="20" /></a></td>
              <td width="30"><a href="E_Doctor.php?id=<?php echo $resultado['id'];?>"><img src="../imagenes/cancel-icon.png" width="20" height="20" /></a></td>
 			</tr>
			<?php }while($resultado=ibase_fetch_assoc($consulta));?>
			</table>

             </td>
            </tr>
           <?php   }
  /*else
  {
		echo"<tr><td align='center' colspan='7'>Sin resultados</td></tr>";  
  }*/?>
          </table></td>
  </tr>
</table>