advanced lists

14 posts by 2 authors in: Forums > CMS Builder
Last Post: March 27, 2015   (RSS)

By rez - March 25, 2015 - edited: March 25, 2015

It was painful, but I got it. How you can select before you join, or how it's known to look ahead for a join while not understanding yet what I'm selecting, I don't know. I would think the join should have been first.

SELECT <?php echo $TABLE_PREFIX ?>locations.num, CONCAT (<?php echo $TABLE_PREFIX ?>state.name, ' - ', city, ' - ',address)
  FROM `<?php echo $TABLE_PREFIX ?>locations`
  JOIN <?php echo $TABLE_PREFIX ?>state ON <?php echo $TABLE_PREFIX ?>locations.state = <?php echo $TABLE_PREFIX ?>state.num

By rez - March 26, 2015

Oh, that is convenient. However, in CMSB, the keys are always automatically num, right? How are you getting the abbreviation into the locations table as a key somewhere before this (if i am understanding correctly)?

By rconring - March 27, 2015

You do not have to always use the record ID as the value for options.  Just make sure that the abbreviation field is not editable in the states master table. 

In the locations table list, Get options from database (advanced)

Section Tablename -states

Use this field for option values - abbreviation

Use this field for option labels - name

I tried to upload a screenshot but something is wrong.  It refuses to accept the file. 

I am late for an appointment and can continue this later if you need more assistance.  I could send you the states table schema and data but the file upload is not working. LOL

Ron Conring
Conring Automation Services
----------------------------------------
Software for Business and Industry Since 1987