[ic] Creating forums using SQL queries

Steven Potter interchange-users@interchange.redhat.com
Fri Dec 28 23:49:12 2001


Jason Kohles wrote:

> 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.
> 
> 

If that is a sutable way of going about it, what is the appropriate syntax?

Thanks

Steven Potter