Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] Search differences



******    message to minivend-users from Stefan Hornburg <racke@linuxia.de>     ******

Mike Heins <mikeh@minivend.com> writes:

> ******    message to minivend-users from Mike Heins <mikeh@minivend.com>     ******
> 
> Quoting Stefan Hornburg (racke@linuxia.de):
> > ******    message to minivend-users from Stefan Hornburg <racke@linuxia.de>     ******
> > 
> > 
> > I like to make a complex SQL query for a search:
> > select * from .. where .. in (12, 15, 22).
> > 
> > Passed in a search form with sq=
> > this results in "BAD SQL" because SQL::Statement don't knows
> > of "in".
> > 
> > If I use [query sql=".."], this seems not to get parsed by SQL::Statement,
> > so I suffices. But the results page is quite complex, so I need
> > several loops over the search list.
> > This works fine:
> > 
> > [search-region]
> > [search-list]
> > ...
> > [/search-list]
> > [/search-region]
> > 
> > ...
> > 
> > [search-region]
> > [search-list]
> > ...
> > [/search-list]
> > [/search-region]
> > 
> > but with query it is not possible to limit the search:
> > 
> > [query list=1 more=1 ml=3]
> > [/query]
> > 
> > ...
> > 
> > [query list=1 more=1 ml=3]
> > [/query]
> > 
> > On the succeeding pages, the first query shows the succeeding results,
> > but the other queries shows always the first 3 results.
> > 
> > Looking into the code Vend::More_in_progress is reset to undef
> > on the first invocation.
> > 
> > Any hints ?
> 
> This is a case of having the products database not in SQL, but the 
> target table in SQL.
> 
> In that case, you need to say [query base=table_that_is_sql sql="...."]
> so the SQL is not touched by SQL::Statement.

Probably I've described my problem not properly. The [query is working
(all relevant databases in this case are SQL) and the sql code within
[query isn't touched by SQL::Statement.

My problem with [query is, that in the second, third ... call to query
the "more" state is forgotten, so there comes the results of the
first page in.

I think if have to code it in [perl to avoid this traps.

Thanks anyway
        Racke

-- 
LinuXia Systems && Cobolt NetServices, eCommerce and more
Shop- und Datenbanklösungen mit MiniVend, Firewalls auf Debian-Basis
http://www.linuxia.de - http://www.cobolt.net
--> Coding from hell and back <--- 
-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: