Detail viewer / related table

3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 27, 2012   (RSS)

By Toledoh - April 26, 2012

Hi Guys,

I still can't get my head around related items... can you help?

I've a table: "our_beers" that has a multitude of beer with fields title, num, description, image etc

I have created another single record editor "manly_taps" where I've created a number of fields tap_1, tap_2 etc that or pull down lists from "our_beers" with value:num & label:title.

Then, I can easily list the beers of tap at manly via;


// load records
list($manly_tapsRecords, $manly_tapsMetaData) = getRecords(array(
'tableName' => 'manly_taps',
'allowSearch' => '0',
'limit' => '1',
));
$manly_tapsRecord = @$manly_tapsRecords[0]; // get first record

// show error message if no matching record is found
if (!$manly_tapsRecord) { dieWith404("Record not found!"); }

and
Tap 1: <?php echo $manly_tapsRecord['tap_1:label'] ?>

What do I need to do to add more information to tap_1... such as the description, images etc.

Thanks!
Cheers,

Tim (toledoh.com.au)

Re: [Jason] Detail viewer / related table

By Toledoh - April 27, 2012

Wow - perfect!

Why didn't I think of that [shocked]
Cheers,

Tim (toledoh.com.au)