Ver Mensaje Individual
  #8 (permalink)  
Antiguo 12/02/2003, 23:12
Avatar de payo22
payo22
 
Fecha de Ingreso: noviembre-2002
Ubicación: México
Mensajes: 839
Antigüedad: 21 años, 5 meses
Puntos: 1
codigo de ejemplo

aqui te mando un codigo de ejemplo:

<html>
<body>
<?php


$link = mysql_connect("localhost","usuario de la BD","password del usuario");
mysql_select_db("prueba",$link);
$sql = "SELECT * FROM clientes WHERE nombre LIKE '%$buscar%'ORDER BY nombre" ;
$result = mysql_query($sql,$link);

if ($row=mysql_fetch_array($result)){
echo "<table border = '1'> \n";
//Mostrramos los nombres de las tablas
//echo "<tr> \ndigo" style = "margin-left:50">echo "</tr> \n";
mysql_field_seek($result,0);

while($field = mysql_fetch_field($result)){
echo "<td><b>$field->name</b></td> \n";
}

echo "</tr> \n";

do{
echo "<tr> \n";
echo "<td>.$row[nombre].</td> \n";
echo "<td>.$row[edad].</td> \n";
echo "<td>.$row[sueldo].</td> \n";
echo "<td>.$row[memo].</td> \n";
}while($row = mysql_fetch_array($result));


echo "</table> \n";

}else{
echo "<p> No se encontro ningun registro!</p> \n";

}
?>
</body>
</html>



espero te sirva