Ver Mensaje Individual
  #8 (permalink)  
Antiguo 21/09/2006, 09:37
Avatar de hulray
hulray
 
Fecha de Ingreso: septiembre-2006
Mensajes: 630
Antigüedad: 17 años, 7 meses
Puntos: 3
Ningun error ni nada, al darle al boton buscar no hace nada :S

<?
include_once('conec.php'); // Aqui se incluye la conexion a la base de datos

if (isset($_GET['id'])) // Si existe la variable "id" en la barra url...
{
$id = $_GET['id'];
$query_Rs = "SELECT * FROM cliente WHERE id = '$id' ORDER BY nombre DESC";
}

//*BUSCADOR DE REGISTROS!*/
if (isset($_GET['buscar']))
{
$buscar = $_GET['buscar'];

$query_Rs =mysql_query("SELECT * FROM cliente WHERE id LIKE '%$buscar%' OR nombre LIKE '%$buscar%' OR empresa LIKE '%$buscar%' ORDER BY rut DESC") or die(mysql_error());
while ($row= mysql_fetch_array($query_Rs))
{
$nombre=$row["nombre"];
$empresa=$row["empresa"];
$rut=$row["rut"];
$telefono=$row["telefono"];
}
}
?>

<input name="buscar" type="text"><input name="buscar" type="button" value="Buscar">

<pre> <strong>Cliente</strong>
Nombre: <input type="text" name="nombre">
Empresa: <input type="text" name="empresa">
RUT: <input type="text" name="rut">
Telefono: <input type="text" name="telefono">