[ic] one-click search with sql database

Kevin Walsh interchange-users@icdevgroup.org
Thu Aug 15 18:38:00 2002


> 
> Hello i am trying to make a one-click search on my postgres db,
> but its always the Sql Module of Jochen Friedman which trys to process the query instead of 
> sending the sql statement directly to my sql database
> 
> i tried it this way :
> <a href="[area scan ml=25/st=sql/tf=artist/sq=SELECT * from products where artist ilike 'a%'/
> sp=catalog]">A</a>
> 
> can someone tell my how to do it correctly ?
> 
The "sq" search parameter will always be handled by the SQL::Statement
module, rather than sending the SQL direct to the database server.  You
wouldn't want remote users to be able to create their own search URI
using arbitrary statements such as "sq=DELETE FROM transactions" :-)

I suggest that you create a specific search page that contains a [query]
tag and then code the new page to format the results.

You could call the page like [area href="yourpage.html" arg="A"] and
then use [data session arg] in your [query].

Otherwise, if you simply want to select products by artists who's name
starts with 'A' or 'a' then there are other ways to do it using ordinary
Interchange search parameters.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/