, aki ta el cod
Código:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>consultar</title>
</head>
<body>
<h1>Consultar por Código del Cliente</h1>
<br>
<form action="view.php" method="post">
Ingrese ID:<input type="text" name="consult" id="consult"/> <br />
<input type="submit" name="boton" id="boton" value="Buscar" />
</form>
<br />
<br>
<br>
</body>
</html>
Código:
<?php
$consult=$_GET['consult'];
$link = mysql_connect("localhost", "root","") or die ("ha ocurrido un error en la conexion");
mysql_select_db("empresa", $link) or die ("no se ha podido seleccionar la base de datos");
$result = mysql_query("SELECT * FROM clientes WHERE id_cliente=$consult", $link)or die("Error en la consulta SQL");
if (mysql_num_rows($result)){
echo "<table border = '1'> \n";
echo "<tr><td>Codigo</td><td>Nombres</td><td>Apellidos</td><td>Direccion</td><td>Ciudad</td><td>Email</td><td>Telefono</td></tr> \n";
while ($row = @mysql_fetch_array($result)) {
echo "<tr><td>".$row["id_cliente"].
"</td><td>".$row["nombres"]."</td>
<td>".$row["apellidos"]."</td>
<td>".$row["direccion"]."</td>
<td>".$row["ciudad"]."</td>
<td>".$row["email"]."</td>
<td>".$row["telefono"]."</td></tr> \n";
}
echo "</table> \n";
}
else
echo "No Se ha encontrado ningun registro";
printf("<a href= busquedad.php>volver</a>");
?>
</body>
</html>
pues solo me muestra el mensaje de error (die)
que hago mal??
gracias y saludos