JOIN question... I think
28 posts by 6 authors in: Forums > CMS Builder
Last Post: July 19, 2011 (RSS)
By Jason - March 8, 2011
You many not need to do a join at all. What type of field is team_home and team_away? Are they list fields?
If so, and if you're using CMS Builder version 2.04 or higher, you can use the :label pseudo field to output the list fields label instead of it's value (ie, the name rather than the number).
It would look like this:
<?php echo $record['team_home:label']; ?>
Hope this helps
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] JOIN question... I think
By mbareara - March 12, 2011
but it doesn.'t work
I receive this error Notice: Undefined index: articoli_correlati_1:label in /home/....... on line 206
This is my code
<?php if ($record['articoli_correlati_1']): ?>
<ul>
<li><?php echo $record['articoli_correlati_1:label']; ?></a>
</li>
</ul>
<?php endif ?>
By Jason - March 14, 2011
What type of field is articoli_correlati_1? What version of CMS Builder are you using?
Let me know.
Thanks
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] JOIN question... I think
By zip222 - July 19, 2011
It is with a "list" field type
getting options from database (advanced)
- option values: num
- label values: title
Re: [zip222] JOIN question... I think
By zip222 - July 19, 2011
Re: [zip222] JOIN question... I think
By Jason - July 19, 2011
If you're using a fairly recent version of CMS Builder and are using a multi-value list (either drop down or check box) you can use the :labels and :values pseudo fields. These fields are arrays of all of the labels or values selected from that field.
A good way to see everything that is available to you in a record is to use the showme() function. This outputs all the data in the variable passed to it. So if you wanted to see everything stored in the variable $record, you would use:
<?php showme($record);?>
Hope this helps
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] JOIN question... I think
By zip222 - July 19, 2011
Re: [zip222] JOIN question... I think
By Jason - July 19, 2011
:labels isn't a single value, but an array of values. For example, if you wanted to output all the labels as a comma separated list, you could do this:
<?php echo join(",", $record['field:labels']); ?>
Hope this helps
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/