Re: How to limit dropdown list to options based on 'in use' rows from lookup table, for webpage using php and postgresql - Mailing list pgsql-php

From Raymond O'Donnell
Subject Re: How to limit dropdown list to options based on 'in use' rows from lookup table, for webpage using php and postgresql
Date
Msg-id 5682DEF5.90909@iol.ie
Whole thread Raw
In response to How to limit dropdown list to options based on 'in use' rows from lookup table, for webpage using php and postgresql  (Killian Driscoll <killiandriscoll@gmail.com>)
List pgsql-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


pgsql-php by date:

Previous
From: Raymond O'Donnell
Date:
Subject: Re: How to limit dropdown list to options based on 'in use' rows from lookup table, for webpage using php and postgresql
Next
From: Raymond O'Donnell
Date:
Subject: Re: How to limit dropdown list to options based on 'in use' rows from lookup table, for webpage using php and postgresql