[Zope-DB] Select in dtml with more than one row

Phil Harris phil.harris@zope.co.uk
26 Sep 2001 15:31:30 -0400


Florian,

I think you sort of missed the point of dtml-in.

dtml-in is somewhat similar to a loop around the record results until
end-of-file.

so, with this:

 <dtml-in "getmessagesbyid(userid=userid)">

       <dtml-call "REQUEST.set('messagehaeder',header)">
       .
       .
       .
</dtml-in>


I'm assuming you are trying to use the value outside of the dtml-in?  If
so then it is doing exactly as you ask, setting messageheader to header,
trouble is when it gets to the end of the loop, the value in there is
the last one :).

What you probably want is something like:

 <dtml-in "getmessagesbyid(userid=userid)">
       <dtml-var header><br>
 </dtml-in>

Which will list all the headers selected in your query.

hth

Phil



On 26 Sep 2001 13:14:11 +0200, Florian Schuler wrote:
> Hello everybody,
> 
> I have a quick question for you ( hope so ). 
> Can you give me a dtml example to display a select * .. with more than
> one result ?
> 
> At the moment I try:
> 
> <dtml-in "getmessagesbyid(userid=userid)">
>       <dtml-call "REQUEST.set('messagehaeder',header)">
>       .
>       .
>       .
> </dtml-in>
> 
> But what should I do if there is more than one "message"
> 
> The <dtml-var messageheader> give me just the last line of my select
> query!
> 
> Thanks in advance
> 
> Florian Schuler
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Zope-DB mailing list
> Zope-DB@zope.org
> http://lists.zope.org/mailman/listinfo/zope-db