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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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@xxxxxx


-- 
Sent via pgsql-php mailing list (pgsql-php@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php



[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux