Ver Mensaje Individual
  #2 (permalink)  
Antiguo 17/02/2011, 14:17
Avatar de bUllan9ebrio
bUllan9ebrio
 
Fecha de Ingreso: enero-2011
Ubicación: Chile
Mensajes: 1.128
Antigüedad: 13 años, 3 meses
Puntos: 128
Respuesta: mostrar registro

Grave error de sintaxis, por que utilizar dos tablas??? y no cerrarlas???

Código HTML:
Ver original
  1. <table width="65%" border="2" cellspacing="0" cellpadding="0">
  2. <table width="65%" border="1" cellspacing="0" cellpadding="0">

por que declarar dos veces un array???

Código PHP:
Ver original
  1. $busqueda = mysql_fetch_array($resultado);
  2. while ($registro = mysql_fetch_array($resultado))


y para que hablar de esto :

Código PHP:
Ver original
  1. while ($registro = mysql_fetch_array($resultado)){
  2. echo $registro['nombre'];
  3.  echo $registro['apellidos'];
  4. echo $registro ['telefono'];




Prueba con esto y para la proxima no coloques todo en una sola linea




Código PHP:
Ver original
  1. <table width="65%" border="2" cellspacing="0" cellpadding="0">
  2. <tr>
  3.  <td width="20%" bgcolor="#FFFFCC">Nombre</td>
  4.  <td width="20%" bgcolor="#FFFFCC">apellidos</td>
  5.   <td width="5%" bgcolor="#FFFFCC">telefono</td>
  6.   </tr>
  7.   <tr>
  8.   <?php include_once("conexion.php");  
  9.   $cadena =("SELECT * FROM reserva");  
  10.   $resultado=mysql_query($cadena, $conexion) or die ("problema con cadena de conexion<br><b>" .  mysql_error()."</b>");
  11.   while ($registro = mysql_fetch_array($resultado))
  12.   {
  13.      $nombre=$registro['nombre'];  
  14.      $apellidos=$registro['apellidos'];
  15.      $telefono=$registro ['telefono'];
  16.   echo '    <td align="center" width="70%">'.$nombre.'</td>
  17.             <td align="center" width="30%">'.$apellidos.'</td>
  18.             <td align="center" width="30%">'.$telefono.'</td></tr>';
  19.   }
  20.   echo '</table>';
  21.   ?>