List field options from another section

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

By Dave - June 18, 2017

Hi andreasml, 

The CMS doesn't support that directly, but you can do it with custom MySQL code.  It's a bit more advanced but give this a try: 

  SELECT num, CONCAT(title, ': ', content)
    FROM `<?php echo $TABLE_PREFIX ?>section_b`
ORDER BY title

The first field is what is stored in the database, the second is what is shown to the user.  The reason we usually want to store a record number in the database is so if the title or content changes we can still find it by record number.

The MySQL CONCAT function joins multiple values together.
Reference: https://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_concat

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com

By andreasml - June 18, 2017

Hi Dave,

It worked right away!!

Many thanks!!

Andreas Lazaris