Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/06/2008, 13:01
Avatar de hulray
hulray
 
Fecha de Ingreso: septiembre-2006
Mensajes: 630
Antigüedad: 17 años, 7 meses
Puntos: 3
Problema hacer con una busqueda

No me arroja los valores, ni tampoco me tira ningun error, me pueden decir que error cometo?

muchas gracias

Código PHP:
<form id="form1" name="form1" method="post" action="control_datos_filtro.php?id_insmodbusqueda=$busqueda\">
  <table width="800" border="0">
    <tr>
      <td><div align="center"><strong><a href="tabla.php">Home</a></strong></div></td>
      <td><div align="center"><strong>Ir a certifiaciones </strong></div></td>
      <td><div align="center"><strong>Buscar inspecci&oacute;n </strong></div></td>
      <td><div align="center"><a href="../../control_datos_filtro.php"><strong>Volver</strong></a></div></td>
    </tr>
  </table>
  <p>&nbsp;</p>
  <table width="800" border="0">
    <tr>
      <td>&nbsp;</td>
      <td><div align="center"><strong>CHILE S.A </strong></div></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><div align="center"><strong>Fecha:</strong> <? echo $fecha?></div></td>
      <td><div align="center"><strong>Informe estatus de inspecciones </strong></div></td>
      <td><div align="center"><strong>Hora:</strong> <? echo $hora?></div></td>
    </tr>
  </table>
  <p><strong>Proyecto</strong>:  <em><? echo $f_proyecto?></em> </p>
  <p align="center">Consulte: 
    <label>
    <select name="campo">
      <option value="ins_folio">Folio</option>
      <option value="ins_nomemp">Empresa</option>
      <option value="ins_nomcon">Contacto</option>
    </select>
    </label>
    <label>
      <input type="text" name="palabra" />
    </label>
    <label>
    <input name="buscar" type="submit" value="Buscar">
    </label>
  </p>
  <table width="800" border="0">
    <tr>
      <td><div align="center"><strong>Folio</strong></div></td>
      <td><div align="center"><strong>Fecha ingreso </strong></div></td>
      <td><div align="center"><strong>Hora ingreso </strong></div></td>
      <td><div align="center"><strong>Empresa</strong></div></td>
      <td><div align="center"><strong>Nombre contacto </strong></div></td>
      <td><div align="center"><strong>E-mail</strong></div></td>
      <td><div align="center"><strong>Fono contacto </strong></div></td>
      <td><div align="center"><strong>Estado</strong></div></td>
    </tr>
        <?php 

//Solicitud de inspección
 
if ( isset( $_POST'buscar' ] )  && isset( $_POST'campo' ] ) && isset( $_POST'palabra' ] )  )


$palabra $_POST['palabra']; 
$campo $_POST['campo']; 


if ( 
$campo == 'ins_folio' )
$consulta "SELECT ins_folio,ins_fecing,ins_hora1,ins_nomemp,ins_nomcon,ins_mailcon,ins_fonocon,ins_estado FROM am_inspeccion WHERE (ins_folio = '".$palabra."') and (ins_proyecto LIKE '$f_proyecto')";

elseif ( 
$campo == 'ins_nomemp' )
$consulta "SELECT ins_folio,ins_fecing,ins_hora1,ins_nomemp,ins_nomcon,ins_mailcon,ins_fonocon,ins_estado FROM am_inspeccion WHERE (ins_nomemp LIKE '%".$palabra."%') and (ins_proyecto LIKE '$f_proyecto') ORDER BY ins_folio DESC";

elseif ( 
$campo == 'ins_nomcon' )
$consulta "SELECT ins_folio,ins_fecing,ins_hora1,ins_nomemp,ins_nomcon,ins_mailcon,ins_fonocon,ins_estado FROM am_inspeccion WHERE (ins_nomop LIKE '%".$palabra."%') and (ins_proyecto LIKE '$f_proyecto') ORDER BY ins_folio DESC";


$query_Rs mysql_query($consulta) or die(mysql_error());

while ( 
$rowmysql_fetch_array$query_Rs ) )


echo 
"    <tr>";
echo 
"      <td><div align=\"center\">$row[0]</a></div></td>";
echo 
"      <td><div align=\"center\">$row[1]</a></div></td>";
echo 
"      <td><div align=\"center\">$row[2]</a></div></td>";
echo 
"      <td><div align=\"center\">$row[3]</a></div></td>";
echo 
"      <td><div align=\"center\">$row[4]</a></div></td>";
echo 
"      <td><div align=\"center\">$row[5]</a></div></td>";
echo 
"      <td><div align=\"center\">$row[6]</a></div></td>";
echo 
"      <td><div align=\"center\">$row[7]</a></div></td>";
echo 
"    </tr>";

          
    
?>
  </table>


</form>
<?
}
?>