Display two fields in List select

4 posts by 3 authors in: Forums > CMS Builder
Last Post: March 17, 2009   (RSS)

Hello,

I have one table, 'cms_contacts' which contains fields:

Forename
Surname

In another table, 'cms_purchases' I want to be able to select the appropriate Contact from the cms_contacts table...

As we have two fields for the Contact Name (forename and surname) I want the drop down within Purchases to display both (forename surname).

The basic 'get options from database' only allows displaying of one field, so can it be done with the 'get options from mySQL'?

I put this in:

SELECT forename,surname FROM cms_contacts

However, it doesn't work - it only displays the SURNAME.

Am I barking up the wrong tree?

Basically I just want the drop down/select on Purchases table to display:

Joe Bloggs
Dave Smith
etc etc

i.e. concatenating the two fields (forename and surname) from the Contacts table.

Many thanks in advanced
Rob

Re: [rjbathgate] Display two fields in List select

By ross - March 17, 2009

Hi Rob

That does sound like it should be something you can do wit the advanced lookup option for list fields. I'll ask Dave to take a look at this one for you when he gets in. He'll let you know what options are available.

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [Dave] Display two fields in List select

Ah ha cheers, thought Concatenating might be the way forward.

Many thanks, works a treat.