Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id C2A059FA298 for ; Sun, 3 Dec 2006 20:00:52 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 79019-03 for ; Sun, 3 Dec 2006 20:00:43 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.186]) by postgresql.org (Postfix) with ESMTP id 76DCA9F9EED for ; Sun, 3 Dec 2006 20:00:47 -0400 (AST) Received: by nf-out-0910.google.com with SMTP id x4so4335717nfb for ; Sun, 03 Dec 2006 16:00:46 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=F4vjGgYpifem3n3C3fenC/QU1UhabjOoDfg569GFzwmr5cYeC/kH0Hi7dwHxPEYmVQHK1KbMgQ8F7RlPJb5Yxn0rhvejoCteg19iYPOnCQGF28ekBaVHg+PtnssZM3d2/qJbSpSytinUfkvwQnX/ABYBT1x5WrMCBljWVtIpnXQ= Received: by 10.78.204.1 with SMTP id b1mr7145874hug.1165190445680; Sun, 03 Dec 2006 16:00:45 -0800 (PST) Received: by 10.78.52.11 with HTTP; Sun, 3 Dec 2006 16:00:45 -0800 (PST) Message-ID: <1cbd6f830612031600xb902e5fgf3eb485a8af59a@mail.gmail.com> Date: Sun, 3 Dec 2006 19:00:45 -0500 From: "Mag Gam" To: Chris Subject: Re: HTML FORMS selected question Cc: "Randy Moller" , pgsql-php@postgresql.org In-Reply-To: <45736235.6080302@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_5924_16292896.1165190445596" References: <457358D9.4000404@gmail.com> <20061203232352.A93629F9F8D@postgresql.org> <1cbd6f830612031543w26cdb6e2s82f1b958009d1b7@mail.gmail.com> <45736235.6080302@gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.55 tagged_above=0 required=5 tests=BAYES_50, HTML_30_40, HTML_MESSAGE, NORMAL_HTTP_TO_IP, SPF_PASS X-Spam-Level: X-Archive-Number: 200612/7 X-Sequence-Number: 3675 ------=_Part_5924_16292896.1165190445596 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Chris + Randy: Sorry, I may of forgetten to give you this: $result = pg_query($dbconn, "select id,address from ip"); This is right before the: $options=pg_fetch_array($result_ip); so, my $results is really all the ip addresses ($rows after I perform the pg_fetch_array). I will add the var_dump to see it (never done it before, I will do some googling :) ) On 12/3/06, Chris wrote: > > Mag Gam wrote: > > Randy + Chris: > > > > Thx for the quick replies! > > > > Chris: > > > > $rows contain ip addresses (postgresql inet) type (example: 192.168.0.1 > > ) > > $options contain ip addresses (postgresql inet0 type (example: 127.0.0.1 > > ) > > (keep in mind) they are both arrays. $rows contact all ips, and $options > > contact the ip addresses that were selected > > > > Randy: > > I am not sure what you mean. The variables look right. I am getting no > > errors! Just the logic is messed up. > > I think Randy's right. > > At the top you have: > > //The values that need to be selected > $result_ip=pg_query($dbconn,$test_query); > ^^^^^^^^^ > but you are doing this: > > while ($row = pg_fetch_array($result)) { > > > $result_ip at the top, $result in the second bit. > > > If you don't see errors, turn up error reporting & display errors: > > error_reporting(E_ALL); > ini_set('display_errors', true); > > > Also that's not what I meant. I meant add a var_dump or print_r at each > stage to see what you are *really* getting from the code. > > > -- > Postgresql & php tutorials > http://www.designmagick.com/ > ------=_Part_5924_16292896.1165190445596 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Chris + Randy:

Sorry, I may of forgetten to give you this:
$result = pg_query($dbconn, "select id,address from ip");

This is right before the:
$options=pg_fetch_array($result_ip);

so, my $results is really all the ip addresses ($rows after I perform the pg_fetch_array).

I will add the var_dump to see it (never done it before, I will do some googling :) )






On 12/3/06, Chris < dmagick@gmail.com> wrote:
Mag Gam wrote:
> Randy + Chris:
>
> Thx for the quick replies!
>
> Chris:
>
> $rows contain ip addresses (postgresql inet) type (example: 192.168.0.1
> <http://192.168.0.1>)
> $options contain ip addresses (postgresql inet0 type (example: 127.0.0.1
> <http://127.0.0.1>)
> (keep in mind) they are both arrays. $rows contact all ips, and $options
> contact the ip addresses that were selected
>
> Randy:
> I am not sure what you mean. The variables look right. I am getting no
> errors! Just the logic is messed up.

I think Randy's right.

At the top you have:

//The values that need to be selected
$result_ip=pg_query($dbconn,$test_query);
^^^^^^^^^
but you are doing this:

while ($row = pg_fetch_array($result)) {


$result_ip  at the top, $result in the second bit.


If you don't see errors, turn up error reporting & display errors:

error_reporting(E_ALL);
ini_set('display_errors', true);


Also that's not what I meant. I meant add a var_dump or print_r at each
stage to see what you are *really* getting from the code.


--
Postgresql & php tutorials
http://www.designmagick.com/

------=_Part_5924_16292896.1165190445596--