Forums / Setup & design / How to fetch collected info list?

How to fetch collected info list?

Author Message

Petter Arneson

Tuesday 09 August 2005 6:56:41 am

I have a simple newsletter subscribe form, and the email adresses entered are collected. I want to loop the content of the ezinfocollection database table to extract <b>all</b> the adresses that are entered for my newsletter. I want to do this dynamic, but the documentation states that the collection_id is required. There must be a way to do this without looping from id 1. (in case your collection starts at f.ex. 120)

Something like this:

{let collection=fetch('content','collected_info_collection',
  hash('object_attribute_id',272,'object_id',67))}

 {section loop=$collection}
  {foreach $collection.attributes}
   {$attribute.contentclass_attribute_name}<br />
   .. send email stuff... 
  {/foreach}
 {/section}

{/let}

I guess I could start from id nr 1 and check on content before proceeding if there's no workaround. Is it possible to write my own sql query in the templates?

- Thanks

www.vzt.no