Ver Mensaje Individual
  #8 (permalink)  
Antiguo 27/06/2007, 15:35
loks
 
Fecha de Ingreso: junio-2007
Mensajes: 19
Antigüedad: 16 años, 10 meses
Puntos: 0
Re: Consultas PHP MYSQL

pongo asi osea...
pongo solo 2 archivos?

consulta.html y ahi pongo

<html>
<head>
<title>CONSULTA</title>
<head>
</head>
<body>
<form action="consulta.php">
<BR><BR><BR>
<center>
<table border=5>
<tr>
<td>Cedula</td>
<td><input name="caja1" size="18" value= ""></td>
</tr>
<TR>
<TD><input type=SUBMIT name=BOTON2 value ="Consultar"></TD>
<TD><input type=RESET name=BOTON1 value ="Borrar"></TD>
</TR>
</table>
</center>
</form>
</body>
</html>

y en consulta.php pongo

<?php
$link = mysql_connect("localhost", "cmartinez", "lunallena");
mysql_select_db("clientes",$link);
$sql = "select * from usuario where ced_cliente = '".mysql_escape_string($_POST['caja1'])."'";
$sql = mysql_query($sql) or die("No se pudo realizar la consulta");
while($row = mysql_fetch_array($sql))
{
echo "Nombre: ".$row['nom_cliente']."<br>";
echo "Direccion: ".$row['dir_cliente']."<br>";
echo "Telefono: ".$row['tel_cliente']."<br>";
echo "Email: ".$row['email_cliente']."<br>";
echo "Status".$row['Status']."<br>";
}
?>

dp cambio por mi info y listo???

me parece raro pq no aparecen las variables etc...