I'm not sure if this would work, but you could try a <dtml-call> method like: <dtml-if expr="search_method == '1'"> <dtml-call "REQUEST.set('sql', sql_1)"> <dtml-elif> ... Then iterate over your results with: <dtml-in sql> do stuff here </dtml-in> Or use a python script as your logic, which is probably a better choice and easier to boot. Then have the script return the results of the ZSQL method. Scott -----Original Message----- From: Steve Lenti [mailto:slenti@abqpubco.com] Sent: Friday, September 19, 2003 10:01 AM To: zope@zope.org Subject: [Zope] dtml-in statement with mysql I have a small question. I have a couple of sql methods defined and depending on the search method I want to excute a specific one and return the results. I want to do something like this <dtml-if expr="search_method == '1'"> <dtml-in sql_1> <dtml-elif expr="search_method == '2'"> <dtml-in sql_2> </dtml-if> ... the rest of the the results the problem I have is that zope doesn't like me using dtml-in statements inside the if statements unless I copy the whole results page into the if statement. What I want to do is depending on what the search_method variable is I want to call a specific sql method without having to put all the code in each if statement. is there anyway to accomplish this. hope I have been clear enough. thanks in advance, --STEVE _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) The information contained in this email message may be privileged and is confidential information intended only for the use of the recipient or any employee or agent responsible for delivering it to the intended recipient. Any unauthorized use, distribution or copying of this information is strictly prohibited and may be unlawful. If you have received this communication in error, please notify the sender immediately and destroy the original message and all attachments from your electronic files.