Tema: Buscador
Ver Mensaje Individual
  #3 (permalink)  
Antiguo 05/11/2010, 12:38
dianays
 
Fecha de Ingreso: agosto-2010
Mensajes: 147
Antigüedad: 14 años, 8 meses
Puntos: 1
Respuesta: Buscador

io hice uno pero por medio de combobox...

Código PHP:
Ver original
  1. //este es para el combo
  2. <?php
  3. $CONEXION = mysql_connect("localhost","root","");
  4. if (!$CONEXION) {
  5. die("p class='Estilo1' align='center'>LO SIENTO, PERO NO HA PODIDO CONECTARSE A MYSQL: </p>" . mysql_error());
  6. }
  7. else{
  8. mysql_select_db("bd_control", $CONEXION);
  9. $ARTICULOS=mysql_query("SELECT folio FROM reporte ");
  10. $ERROR = mysql_error($CONEXION);
  11. if(empty($ERROR)){
  12. echo "<select name=ART>";
  13. echo "<option selected='' value=''> [ Seleccione ] </option>";
  14. while ($ARTICULO=mysql_fetch_array($ARTICULOS)){
  15. echo "<option value=".$ARTICULO["folio"].">".$ARTICULO["folio"]."</option>";
  16. }              
  17. echo "</select>";
  18. }
  19. else{
  20. $ERROR_CONSULTA="NO SE PUEDEN MOSTRAR LOS DATOS DEBIDO AL SIGUIENTE ERROR: ";
  21. }
  22. }
  23. ?>
<input type="submit" name="ACEPTAR" value="ACEPTAR" />
Código PHP:
Ver original
  1. <?php
  2. if (isset($_POST["ACEPTAR"])){
  3. $ART=$_POST["ART"];
  4. $ART_SEL=mysql_query
  5. ("SELECT folio, fecha, hora, unidad, nombre
  6. FROM reporte, unidades, usuarios  
  7. WHERE reporte.id_unidad=unidades.id_unidad
  8. AND reporte.id_nom=usuarios.id_nom
  9. AND reporte.folio=$ART");
  10. $error=mysql_error($CONEXION); echo $error;
  11. $fila=mysql_fetch_array($ART_SEL);
  12. if(mysql_num_rows($ART_SEL)){
  13. echo "<table width='800' border='1' align='center'>
  14. <tr>
  15. <th width='90' scope='col'>FOLIO</th>
  16. <th width='66' scope='col'>FECHA</th>
  17. <th width='65' scope='col'>HORA</th>
  18. <th width='69' scope='col'>UNIDAD</th>
  19. <th width='66' scope='col'>NOMBRE</th>
  20. </tr>
  21. <tr>
  22. <td>".$fila['folio']."</td>
  23. <td>".$fila['fecha']."</td>
  24. <td>".$fila['hora']."</td>
  25. <td>".$fila['unidad']."</td>
  26. <td>".$fila['nombre']."</td>
  27. </tr>
  28. </table>";
  29. }
  30. else{
  31. echo "<div class='Estilo2' align='center'>EL FOLIO NO EXISTE</div>";
  32. }
  33. }
  34. ?>

Espero te sirba para que puedas guiarte...
__________________
ѕiεмpяε εѕтoy ѕoñαиdo *εи iиviεrиo coи εℓ ѕoℓ, coи ℓαѕ иubεѕ εи vεrαиo*
***DiαиiтHα***