
<?php
$bd="tecweb";
$conexion=mysql_connect("localhost", "root", "")
or die("Problemas en la Conexion");
mysql_select_db($bd, $conexion)
or die("Problemas en la seleccion de la base de datos");
$registros=mysql_query("select id, matricula, nombre, paterno, materno, edad, direccion, telefono, email from alumnos",$conexion)
or die("Problemas en el select".mysql_error());
echo "<table border=1>";
echo "<tr><td>Id</td><td>Matricula</td><td>Nombre</td><td>Apellido Paterno</td><td>Apellido Materno</td><td>Edad</td><td>Direccion</td><td>Telefono</td><td>E-Mail</td></tr>";
while($reg=mysql_fetch_array($registros)){
echo "<tr>";
echo "<td>".$reg['id']."</td><br>";
echo "<td>".$reg['matricula']."</td><br>";
echo "<td>".$reg['nombre']."</td><br>";
echo "<td>".$reg['paterno']."</td><br>";
echo "<td>".$reg['materno']."</td><br>";
echo "<td>".$reg['edad']."</td><br>";
echo "<td>".$reg['direccion']."</td><br>";
echo "<td>".$reg['telefono']."</td><br>";
echo "<td>".$reg['email']."</td><br>";
echo "</tr>";
}
echo "</table>";
mysql_close($conexion);
?>