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: 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 16:35:10 +0000
Message-ID: <5682B63E.80808@iol.ie> (raw)
In-Reply-To: <CAL64pZNGxLQZ=haCh4Fu0H49VtjGPH8g7ced5Te4gorB1j7ciA@mail.gmail.com>
References: <CAL64pZNGxLQZ=haCh4Fu0H49VtjGPH8g7ced5Te4gorB1j7ciA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-php>

On 29/12/2015 16:23, Killian Driscoll wrote:
> I have a table country with a lookup table to country_type.
> 
> table country
> 
> country_id (pk), col2, col3, country_type_id (fk) integer
> 
> lookup table
> 
> country_type country_type_id (pk), type_name varchar
> 
> My lookup table has 50 country types, but only 20 are 'in use' in the
> current db (with the rest possibly used later as the db expands). On the
> webpage I am creating (I am using a php generator) I can set it up to
> add a filter by country type based on the country type_name varchar - so
> one can view the country types by name rather than the id integer - but
> all 50 types are listed.
> 
> I only want the 20 that currently 'in use' (not sure if this is the best
> way to describe it) and therefore relevant to searches/filters (i.e. I
> don't want to see a "There are no records to display" message).

How do you define "in use"? Is it a switch turned on and off by an
admin? is it based on how often that country is chosen by a user? Maybe
something else?

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)  latest in thread

Message-ID: <5682B63E.80808@iol.ie>
Permalink:  ../5682B63E.80808@iol.ie/
Also on:    postgresql.org/message-id/5682B63E.80808@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: <5682B63E.80808@iol.ie>
  References: <CAL64pZNGxLQZ=haCh4Fu0H49VtjGPH8g7ced5Te4gorB1j7ciA@mail.gmail.com> <5682B63E.80808@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