pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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: Thu, 31 Dec 2015 11:34:22 +0000
Message-ID: <568512BE.9070105@iol.ie> (raw)
In-Reply-To: <CAL64pZN40T0UrM5Dd8Szbo-3Gy_p55Gr9sOu+tfzzT-5_6NvNw@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>
	<5682DEF5.90909@iol.ie>
	<CAL64pZOhwMABWWveBbUwc0MJc-b26rCXJXDeKYiCqOhPZ0xk9w@mail.gmail.com>
	<56830DAA.5040301@iol.ie>
	<CAL64pZN40T0UrM5Dd8Szbo-3Gy_p55Gr9sOu+tfzzT-5_6NvNw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-php>

On 30/12/2015 08:41, Killian Driscoll wrote:
> On 29 December 2015 at 23:48, Raymond O'Donnell <rod@iol.ie
> <mailto:rod@iol.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@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



view thread (9+ messages)

Message-ID: <568512BE.9070105@iol.ie>
Permalink:  ../568512BE.9070105@iol.ie/
Also on:    postgresql.org/message-id/568512BE.9070105@iol.ie

 · 

reply

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: <568512BE.9070105@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> <CAL64pZOhwMABWWveBbUwc0MJc-b26rCXJXDeKYiCqOhPZ0xk9w@mail.gmail.com> <56830DAA.5040301@iol.ie> <CAL64pZN40T0UrM5Dd8Szbo-3Gy_p55Gr9sOu+tfzzT-5_6NvNw@mail.gmail.com> <568512BE.9070105@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