Vili, I'm not sure I understand what you're trying to do.  

Here's what I get:  you know how to query the database for a list of
models, and you know how to list those models on a web form with
checkbox selectors.  What you're asking is how to query for further info
after a user checks some boxes and submits the form.  Right?  If not,
then ignore this.  :)

Values from a select boxes are returned as a postarg array.  The easiest
way would probably be to use <@MAP> to turn your array into a
comma-delimited string (you may have to assign the array to a variable
first).  Then you can query where model in (@@yourstring).  This is new
with W5, though.

If you're using an older version, you'll have to do a FOR loop through
your postarg array and either concatenate it to a string and do an IN
query, or run a query for each selection.  

As far as the Search Action vs Direct DBMS - it depends on what you're
trying to do.  You can do either of the above with a search action.

Does that help?

jamileh



> -----Original Message-----
> From: McElhinny, Greg [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 16, 2004 6:39 AM
> To: [EMAIL PROTECTED]
> Subject: RE: Witango-Talk: Checkbox for database criteria
> 
> 
> Vili,
> 
> You may also want to look at the 'in' instead of =.
> e.g. Select * from vehicles where model in ('MERCEDES', 'AUDI', 
> 'FIAT', 'FORD', 'OPEL')
> 
> Greg
> 
> -----Original Message-----
> From: Vili Cankar [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 16, 2004 7:27 AM
> To: [EMAIL PROTECTED]
> Subject: Witango-Talk: Checkbox for database criteria
> 
> 
> Hi,
> 
> I just wonder if someone can help me with this problem:
> 
> I have following SQL statement:
> 
> 
> select * from vehicles where model = 'MERCEDES'
>                          and model = 'AUDI'
>                          and model = 'FIAT'
>                                                               
>                         and model = 'FORD'
>                          and model = 'OPEL'
>  
> 
> 
> I know how to display models from database with check box that I want 
> to include them in the criteria. (There are no fixed models in the 
> sistem, they are read from table in database.)
> 
> Is it better to use DIRECT DBMS or SEARCH ACTION and would someone 
> give me a hint how to build queryes for users who just check 
> checkboxes next to the right models ?
> 
> Regards, Vili CANKAR
> 
> ______________________________________________________________
> __________
> TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
> ______________________________________________________________
> __________
> TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
> 
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to