Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/09/2006, 08:25
Avatar de hulray
hulray
 
Fecha de Ingreso: septiembre-2006
Mensajes: 630
Antigüedad: 17 años, 7 meses
Puntos: 3
Pregunta Problema codigo buscar

No me busca, yo al darle al boton buscar me arroja toda la base de datos, y tambien necesito que los valores me los de en los textbox que tengo mas abajo, por favor si alguien me puede ayudar con esto

<?
include ("conexion.php");
//*BUSCADOR DE REGISTROS!*/
if (isset($_POST['buscar']))
{
$buscar = $_POST['buscar'];
$nombre = $_POST['nombre'];
$empresa = $_POST['empresa'];

$query_Rs =mysql_query("SELECT * FROM cliente WHERE nombre LIKE '%$nombre%' OR empresa LIKE '%$empresa%' ORDER BY rut DESC") or die(mysql_error());
while ($row= mysql_fetch_array($query_Rs))
{
echo $row["nombre"]."<br>";
echo $row["empresa"]."<br>";
echo $row["rut"]."<br>";
echo $row["telefono"]."<br><br>";
}
}
else
{
?>
<form method="post" action="<?php $_SERVER['PHP_SELF'];?>"
<input name="buscar" type="text"><input name="buscar" type="submit" 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">
</form>
<?php
}
?>