Ver Mensaje Individual
  #5 (permalink)  
Antiguo 18/08/2008, 12:20
JuanCarlos
 
Fecha de Ingreso: noviembre-2003
Ubicación: En lo mas profundo de tu alma.
Mensajes: 93
Antigüedad: 20 años, 5 meses
Puntos: 0
Respuesta: agregar campo de texto y boton buscar??

Bueno gracias ha todos por sus sugerencias de tanto buscar probar y leer por fin conseguí la forma de hacerlo en realidad era algo fácil de hacer simplemente cree otra pagina coloque un formulario cree un list box con los valores tomados de la base de datos (para que no haya errores para ingresar el parámetro de búsqueda) y un botón enviar y el formulario por el método GET lo envié a la pagina donde tenia el código es decir, el código que tenia arriba y me trajo la consulta....

algo asi para los que les pueda interesar....

Código PHP:
<?php require_once('Connections/modulo_1.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? "'" doubleval($theValue) . "'" "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}
}

mysql_select_db($database_modulo_1$modulo_1);
$query_rs_nombre_operador "SELECT nombre_operador FROM linea_autobus";
$rs_nombre_operador mysql_query($query_rs_nombre_operador$modulo_1) or die(mysql_error());
$row_rs_nombre_operador mysql_fetch_assoc($rs_nombre_operador);
$totalRows_rs_nombre_operador mysql_num_rows($rs_nombre_operador);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t&iacute;tulo</title>
</head>

<body>
<form id="form1" name="form1" method="get" action="buscar_linea.php">
Nombre del Operador
<select name="nombre_operador" id="nombre_operador" accesskey="c" tabindex="1">
  <option value="value" <?php if (!(strcmp("value"$row_rs_nombre_operador['nombre_operador']))) {echo "selected=\"selected\"";} ?>>Seleccione una opción</option>
  <?php
do {  
?>
  <option value="<?php echo $row_rs_nombre_operador['nombre_operador']?>"<?php if (!(strcmp($row_rs_nombre_operador['nombre_operador'], $row_rs_nombre_operador['nombre_operador']))) {echo "selected=\"selected\"";} ?>><?php echo $row_rs_nombre_operador['nombre_operador']?></option>
  <?php
} while ($row_rs_nombre_operador mysql_fetch_assoc($rs_nombre_operador));
  
$rows mysql_num_rows($rs_nombre_operador);
  if(
$rows 0) {
      
mysql_data_seek($rs_nombre_operador0);
      
$row_rs_nombre_operador mysql_fetch_assoc($rs_nombre_operador);
  }
?>
  </select>
<input type="submit" name="enviar" id="enviar" value="Enviar" />
</form>
</body>
</html>
<?php
mysql_free_result
($rs_nombre_operador);
?>
GRACIAS Avatar810 Y GRACIAS damito SUS SUGERENCIAS ME ABRIERON ALGO LA MENTE...

SALUDOS
__________________
Los consejos son ayuda, no cabe duda...

Pero no olvides que la solución de nuestros problemas está dentro de nosotros mismos.

C. Torres Pastorino.


Hasta luego..................... :adios: