pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: enzo venegas palacios <enzovenegas@mixmail.com>
To: pgsql-php@postgresql.org <pgsql-php@postgresql.org>
Subject: Re: value of record
Date: Fri, 13 Apr 2007 16:26:22 -0500
Message-ID: <E1HcTHh-00048g-00@relay.mixmail.com> (raw)


$res_p=pg_query($bd,"Select * From tabla1 inner join tabla2 on tabla1.cod 
= tabla2.cod where tabla1.fceha = '$fecha' and tabla1.rut = 100 order by 
tabla2.cod_prod");

$reg_p = pg_num_rows($res_p);

$row=0;
$line=-1;

while ( $row < $reg_p ):
  $data = pg_fetch_object($res_p, $row);
  $producto = ($data->cod_prod);
  $data2 = pg_fetch_object($res_p, $line);
  $producto2 = ($data2->cod_prod);

  if ($producto2 <> $producto){
      // desplega encabesado de registro y primer registro de grupo
  }else{
      // desplega registro de detalle
  }
$row++;
$line++;
endwhile;

al comparar la primera vez (cuando $row es 0 y line es -1) $producto2 no 
debe tener valor por que y en la comparacion deberia desplegar el 
encabezado, y lo que esta haciendo es asignar el valor de $producto a $ 
producto2 (osea la linea -1 toma los valores de la linea 0), esta rutina la 
ocupo desde que empese a programar, y este error me aparecio ahora por 
lo que creo que puede ser configuracion, ojala alguien sepa que puede ser.
---------------------------------------------------------
Registra tu dominio en http://dominios.ya.com/. Con cada registro te regalamos 20 cuentas de correo de 100MB cada una.
Ya.com ADSL 24h + Llamadas Nacionales y Locales 24h + Llamadas a MÓVILES.
Desde 9,95 €/mes+IVA. http://acceso.ya.com/ADSLllamadas/3mbvoz/



view thread (5+ messages)

Message-ID: <E1HcTHh-00048g-00@relay.mixmail.com>
Permalink:  ../E1HcTHh-00048g-00@relay.mixmail.com/
Also on:    postgresql.org/message-id/E1HcTHh-00048g-00@relay.mixmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: enzovenegas@mixmail.com
  Subject: Re: value of record
  In-Reply-To: <E1HcTHh-00048g-00@relay.mixmail.com>
  References: <E1HcTHh-00048g-00@relay.mixmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox