|
<HTML> <HEAD> <TITLE>lectura.php</TITLE> </HEAD> <BODY> <h1><div align="center">Lectura de la tabla</div></h1> <br> <br> <? //Conexion con la base mysql_connect("localhost","tu_user","tu_password"); //selección de la base de datos con la que vamos a trabajar mysql_select_db("mi_base_datos"); //Ejecutamos la sentencia SQL $result=mysql_query("select * from clientes"); ?> <table align="center"> <tr> <th>Nombre</th> <th>Teléfono</th> </tr> <? //Mostramos los registros while ($row=mysql_fetch_array($result)) { echo '<tr><td>'.$row["nombre"].'</td>'; echo '<td>'.$row["telefono"].'</td></tr>'; } mysql_free_result($result) ?> </table> <div align="center"> <a href="insertar.html">Añadir un nuevo registro</a><br> <a href="actualizar1.php">Actualizar un registro existente</a><br> <a href="borrar1.php">Borrar un registro</a><br> </div> </BODY> </HTML> |
| Por: marko | 11/5/04
|
| Por: ness | 24/9/04
|
| Por: Juan Perilla | 08/4/05
|
| Por: alberto leon (http://www.lineacentral.com) | 14/12/05
|
| Por: DaBuCoDoNoSoR | 04/3/06
|
| Por: jorge... | 02/8/07
|