Re: How to limit dropdown list to options based on 'in use' rows from lookup table, for webpage using php and postgresql
Raymond O'Donnell <[email protected]> Thu, 31 Dec 2015 11:34:22 +0000
| Newsgroups | gmane.comp.db.postgresql.php |
|---|---|
| Message-ID | <[email protected]> |
On 30/12/2015 08:41, Killian Driscoll wrote: > On 29 December 2015 at 23:48, Raymond O'Donnell <[email protected] > <mailto:[email protected]>> 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 [email protected] -- Sent via pgsql-php mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-php