Where clause on a joined field?

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

By Shore - October 26, 2009

Hello,

I have a video gallery, and each video has a category field. The categories are stored in a separate table called "categories" so I am able to add more categories down the road.

I'm trying to do this:

<?php

require_once "/home/test/public_html/cmsAdmin/lib/viewer_functions.php";

list($videoRecords, $videoMetaData) = getRecords(array(
'tableName' => 'video',
'where' => 'category = "A category"',
));

?>

but it's not understanding my Where clause.

I noticed in CMSB's generated viewer foreach code that the category field was being joined, as below:

<?php echo join(', ', getListLabels('video', 'category', $record['category'])); ?>


How do I modify the Where clause from above so that I can create a list of videos from a specific category?

And can I create additional $videoRecords lists for each other category, that way I can arrange each list on the page where I want it.

Thanks

Re: [Shore] Where clause on a joined field?

By Donna - October 27, 2009

Hi Shore!

Glad to hear you got that figured out! :) Let us know if there's anything else we can help you with.
Donna

--
support@interactivetools.com