[ic] Creating forums using SQL queries

Jason Kohles interchange-users@interchange.redhat.com
Fri Dec 28 22:52:01 2001


On Fri, Dec 28, 2001 at 09:26:47PM -0600, Steven Potter wrote:
> I'm trying to setup an order page where the customers can select which 
> charity they would like a portion of their order donated to.
> 
> The first thing I would like them to do is select which state the 
> charity is located in.  This is what I am thinking:
> 
> [loop list="[query sql="select distinct state from table where 1=1 order 
> by state" type=list]"]
> <option>[sql-state]</option>
> [/loop]
> 
> I'm sure there are some syntax errors in there.  My question is, is this 
> the best way to do it?  Is there some way of accomplishing this without 
> the query tag?
> 
There is code on the checkout forms in the foundation demo
(pages/ord/checkout.html) that creates a list of states.  If you wanted to
do it with a query though, 'select distinct state from table order by state'
would be sufficient, you don't need a where clause in this instance.

-- 
Jason Kohles                                 jkohles@redhat.com
Senior System Architect                      (703)786-8036 (cellular)
Red Hat Professional Consulting              (703)456-2940 (office)