Foros del Web » Programando para Internet » PHP »

Extraccion de datos incompleta

Estas en el tema de Extraccion de datos incompleta en el foro de PHP en Foros del Web. MI PROBLEMA ES QUE CUANDO UN USUARIO HA HECHO EJEMPLO 3 PAGOS A MI SISTEMA DE COBRANZA SOLO ME MUESTRA CUANDO IMPRIMO CON HTML 2 ...
  #1 (permalink)  
Antiguo 03/11/2010, 21:40
 
Fecha de Ingreso: julio-2010
Ubicación: mexico DF
Mensajes: 34
Antigüedad: 13 años, 8 meses
Puntos: 0
Busqueda Extraccion de datos incompleta

MI PROBLEMA ES QUE CUANDO UN USUARIO HA HECHO EJEMPLO 3 PAGOS A MI SISTEMA DE COBRANZA SOLO ME MUESTRA CUANDO IMPRIMO CON HTML 2 FALTANDO EL ULTIMO PAGO QUE EFECTUO, HE REVIZADO Y SI ALMACENA LOS TODOS LOS PAGOS , PERO NO LOS TRAE TODOS POR LO QUE CREO QUE MI PROBLEMA ESTA EN LA EXTRACCION DE DATOS ASI LOS EXTRAIGO:

Código PHP:
<?php require_once('Connections/cn.php'); ?>
<?php

$valor
=$_GET["ID"];
mysql_select_db($database_cn$cn);
$sql="select * from pagos where ID_alumno='$valor'  ";
$sql2="select * from alumnos where ID='$valor' ";

$r=mysql_query($sql);
$r2=mysql_query($sql2);
$res=mysql_fetch_array($r);
$res2=mysql_fetch_array($r2);
?>
<?php
    
while ($res=mysql_fetch_array($r))
{
?>
<tr class="Estilo1">
<td width="100" align="center" valign="top">
<?php echo $res["ID"];?>
</td>
<td width="250" align="center" valign="top">
<?php echo $res2["nombre"];?>
</td>
<td width="80" align="center" valign="top">
<?php echo $res["conceptopago"];?>
</td>
<td width="70" align="center" valign="top">
<?php echo $res["periodopago"];?>
</td>
<td width="60" align="center" valign="top">
<?php echo $res["cantidad"];?>
</td>
<td width="100" align="center" valign="top">
<?php echo $res["facorec"]?>
</td>
<td width="120" align="center" valign="top">
<?php echo $res["fechapago"]?>
</td>
<td width="50" align="center" valign="top">
<?php echo $res["hora"]?>
</td>
</tr>
<?php
}
?>
SIEMPRE ME FALTA UN REGISTRO AYUDA

MUCHAS GRACIAS POR SU AYUDA!!!!
  #2 (permalink)  
Antiguo 04/11/2010, 03:22
 
Fecha de Ingreso: marzo-2010
Ubicación: Barcelona
Mensajes: 657
Antigüedad: 14 años, 1 mes
Puntos: 26
Respuesta: Extraccion de datos incompleta

Quando haces el 1º $res=mysql_fetch_array($r); te saltas uno en el resultado, es decir ya te comes ese que te falta y que cuando hagas el bucle no saldrá. Intenta a eliminar esa fila y a ver si te sale todos los resultados correctamente.

Etiquetas: incompleta
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:23.