[ic] Re: not working on another table?

John Allman interchange-users@icdevgroup.org
Thu Aug 29 10:49:01 2002


racke@linuxia.de wrote:
> John Allman writes:
> 
>> i'm a newbie to interchange so this may be stupid. i have googled and 
>> done my best to search the archives but i cant find an answer!
>> i have created a new table called news. i have created the 
>> dbconf/mysql/news.mysql file (as you can guess i'm using mysql:), the 
>> products/news.txt and products/news.sql files. i have added an entry 
>> to the table. a query statement returns the contents of the table no 
>> problem:
>> [query st=db arrayref=myref sql="select sku from news order by sku"]
>> <!-- make query, this container text is not used. -->
>> [/query]
>> [perl]
>>                 # Get the query results, has multiple fields
>>                 $Scratch->{thingycount} = 0;
>>                 my $ary = $Tmp->{myref};
>>                 $Scratch->{thingy} = "";
>>                 foreach $line (@$ary){
>>                         ($sku) = @$line;
>>                         $Scratch->{thingy} .= $sku."<br>\n";
>>                 }
>>                 return;
>> [/perl]
>> skus are [scratch thingy]
>> however when i try a simple loop it returns nothing and nothing is 
>> reported as being wrong in the error.log:
>> [loop  search="fi=news/st=db/ra=yes"]
>> [loop-field sku]
>> [/loop]
> 
> 
> Either use rf=sku,... in the search parameter or [loop-data news sku]
> within the loop.
> Bye
>   Racke
> 
> 

thanks! that worked a charm. unfortunately i dont understand why it 
works though. i dont know what rf=sku does. i would rtfm except i cant 
find it there either!:(

any hope of pointing me to a good place to read about loops and searches 
and in particular more and more-list?

John