can't believe couldn't find answer to this list viewer question

3 posts by 2 authors in: Forums > CMS Builder
Last Post: December 4, 2011   (RSS)

Re: [equinox69] can't believe couldn't find answer to this list viewer question

By Jason - December 4, 2011

Hi,

The reason that this query is difficult is because all upload information is stored in the uploads table, not in the section where you uploaded the image. Uploads are brought in by the getRecords function.

You can accomplish this query by putting in a sub query that will find all the models records that have an upload attached to it.

Try this:

list($newsRecords, $newsMetaData) = getRecords(array(
'tableName' => 'models',
'perPage' => 11,
'where' => " model_testimonial != '' AND num IN (
SELECT recordNum FROM `{$TABLE_PREFIX}uploads` WHERE tableName = 'models' AND fieldName = 'image')",
));


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] can't believe couldn't find answer to this list viewer question

By Codee - December 4, 2011

perfectamente bien Jason! Thank you!