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

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Killian Driscoll <killiandriscoll(at)gmail(dot)com>, PostgreSQLPHP <pgsql-php(at)postgresql(dot)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: 2015-12-31 11:34:22
Message-ID: 568512BE.9070105@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

On 30/12/2015 08:41, Killian Driscoll wrote:
> On 29 December 2015 at 23:48, Raymond O'Donnell <rod(at)iol(dot)ie
> <mailto:rod(at)iol(dot)ie>> wrote:
>
> On 29/12/2015 19:33, Killian Driscoll wrote:
>
> > 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?
> >
> >
> > No, it's a php generator, so my only option is to put in the WHERE
> > clause in the option box provided, but from the produced php, it looks
> > like it's going in the wrong option box.....
>
> Hmm, afraid I can't help you with that, so, as I don't know what you're
> using.
>
>
> I'm using Maestro php generator (I have v. little experience with
> postgresql or php: I'm an archaeologist....).
>
> As a possible workaround, I have created a view with a DISTINCT ON that
> gives the rows from the lookup table that are used to date, and then in
> the php generator I can link the lookup table's type_id to that view
> when building the filter. It works, but I'm concerned that this may be
> 'messy' or bad practice: any thoughts?

Well, you're always going to be limited by whatever the generator does,
so it really comes down to tricking it into giving you what you want -
so in this case I wouldn't worry about messiness as long as the results
are right. :-)

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Olorin 2017-01-03 10:46:01 Fatal error: Call to undefined function pg_Connect()
Previous Message Raymond O'Donnell 2015-12-29 19:28:53 Re: How to limit dropdown list to options based on 'in use' rows from lookup table, for webpage using php and postgresql