Setting a list record from other table - field relationship

3 posts by 2 authors in: Forums > CMS Builder
Last Post: June 20, 2016   (RSS)

By Damon - April 27, 2016

Hi Jesus,

I'm not exactly sure of what the rules you want to apply. Only show a city once which means record number 4 wouldn't appear?

What is the MySQL you are using to bring this data into the list field?

If you want to remove duplicate cities, in your MySQL query use DISTINCT and use ORDER BY to sort.

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By Jesus - June 20, 2016

Hi,

For future reference I was able to make it work like this.

I've a field named city with field type list and on list options I'm using Get options from MySQL query (advanced) where I'm using this code:

SELECT * FROM ( 
    SELECT city  FROM cmsb_clients
    ORDER BY city DESC
) AS tmp_table group by city

And this its just giving me the cities from the cmsb_clients table but just once each.

Thanks for your help, I found a this thread today while browsing the forums and I just updated.

Jesus