Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/11/2012, 17:48
gregm15
 
Fecha de Ingreso: noviembre-2012
Mensajes: 19
Antigüedad: 11 años, 5 meses
Puntos: 0
Formulario php no imprime registros

hola, hice este programa y obvio ya hice su base de datos como corresponde y segun yo esta todo bien, pero al momento de ejecutarlo con el wamp no aparece nada, no imprime nada, la pagina se queda totalmente en blanco, deberia imprimir una tabla con los registros, y no encuentro el error

<?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);
?>

Última edición por gregm15; 12/11/2012 a las 18:02