From: Raymond O'Donnell <rod@iol.ie>
To: Killian Driscoll <killiandriscoll@gmail.com>
To: PostgreSQLPHP <pgsql-php@postgresql.org>
Subject: Re: How to limit dropdown list to options based on 'in use' rows from lookup table, for webpage using php and postgresql
Date: Tue, 29 Dec 2015 19:28:53 +0000
Message-ID: <5682DEF5.90909@iol.ie> (raw)
In-Reply-To: <CAL64pZMbuQ6WVuBoG02eoq++0-bkWit392JqGh12H+M06sgQPg@mail.gmail.com>
References: <CAL64pZNGxLQZ=haCh4Fu0H49VtjGPH8g7ced5Te4gorB1j7ciA@mail.gmail.com>
<5682B63E.9030008@iol.ie>
<CAL64pZOJZ+1=bzz8gtqAbxngYuFuJs+gJpeuBuuUrC61SeRGyw@mail.gmail.com>
<5682BBF3.1020605@iol.ie>
<CAL64pZOJJR2jEa3gLdS+7k3vJPStpsN5qd7pgmz=pM9=h0+wZw@mail.gmail.com>
<5682C041.40706@iol.ie>
<CAL64pZNrh3e8sVrm6MKbz8_4TrRgi7F532JiKLySp0=44YfecA@mail.gmail.com>
<5682CE53.1030409@iol.ie>
<CAL64pZMbuQ6WVuBoG02eoq++0-bkWit392JqGh12H+M06sgQPg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-php>
On 29/12/2015 18:28, Killian Driscoll wrote:
> Not sure what went wrong, but there's an error: here is the php produced
> by the generator: the data show surveypoints instead of countries, but
> using the same lookup principle:
>
> $lookupDataset = new TableDataset(
> new PgConnectionFactory(),
> GetConnectionOptions(),
> '"irll"."surveypoint_type"');
> $field = new IntegerField('surveypoint_type_id', null, null,
> true);
> $field->SetIsNotNull(true);
> $lookupDataset->AddField($field, true);
> $field = new StringField('surveypoint_type_name');
> $lookupDataset->AddField($field, false);
> $field = new StringField('surveypoint_type_description');
> $lookupDataset->AddField($field, false);
> $lookupDataset->setOrderByField('surveypoint_type_name',
> GetOrderTypeAsSQL(otAscending));
>
> $lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(),
> 'exists select 1 from surveypoint ct
> inner join surveypoint_type lt on (ct.surveypoint_type_id =
> lt.surveypoint_type_id)'));
>
> $this->AdvancedSearchControl->AddSearchColumn($this->AdvancedSearchControl->CreateLookupSearchInput('surveypoint_type_id',
> $this->RenderText('Survey point Type'), $lookupDataset,
> 'surveypoint_type_id', 'surveypoint_type_name', false, 0));
I'm afraid I don't know whatever framework you're using. Have you any
way of getting it to generate the actual SQL query?
Ray.
--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie
--
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php
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: rod@iol.ie, killiandriscoll@gmail.com
Subject: Re: How to limit dropdown list to options based on 'in use' rows from lookup table, for webpage using php and postgresql
In-Reply-To: <5682DEF5.90909@iol.ie>
References: <CAL64pZNGxLQZ=haCh4Fu0H49VtjGPH8g7ced5Te4gorB1j7ciA@mail.gmail.com> <5682B63E.9030008@iol.ie> <CAL64pZOJZ+1=bzz8gtqAbxngYuFuJs+gJpeuBuuUrC61SeRGyw@mail.gmail.com> <5682BBF3.1020605@iol.ie> <CAL64pZOJJR2jEa3gLdS+7k3vJPStpsN5qd7pgmz=pM9=h0+wZw@mail.gmail.com> <5682C041.40706@iol.ie> <CAL64pZNrh3e8sVrm6MKbz8_4TrRgi7F532JiKLySp0=44YfecA@mail.gmail.com> <5682CE53.1030409@iol.ie> <CAL64pZMbuQ6WVuBoG02eoq++0-bkWit392JqGh12H+M06sgQPg@mail.gmail.com> <5682DEF5.90909@iol.ie>
* 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