MiniVend Akopia Services

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

Re: SQL Searches etc. Was: makecat templates (fwd)




Well, lets see, the sql_query will be very different depending on your
table structure. I like to use a scratch variable or a search profile
(etc/search.profiles).

[set my_sql_search]
mv_searchtype=sql
mv_sql_query=SELECT p.code FROM products p WHERE p.title like 'abc%' =
mv_matchlimit=25
[/set]

<A Href="[area href="scan" arg="mp=my_sql_search"]">search for abc</A>

That's really all there is to searching.
See: http://www.minivend.com/minivend/docindex/11.07.SQL_searches.html

As far as using it in other pages I use a variety of methods.
Basically, it's all in the docs.
Look at the [sql] tag and use it in perl, just like the docs say:
http://www.minivend.com/minivend/docindex/08.03.SQL_Access_Methods.html

If you have specific troubles I can try to help.

I like these methods since my Select statement can be really complex at
times.

This is one particularly neat way to do things:
have a page that takes a parameter to determine what it displays
	<A Href="[area page_name param]">
use the param like this in the destination page:

[sql type="list" query="SELECT blah FROM foo WHERE id = [data session
arg]"]
[sql-param 0], [sql-param 1]
[/sql]


-Erik


On Wed, 7 Jul 1999, Russ wrote:

> ******    message to minivend-users from "Russ" <russ@khouse.org>     ******
> 
> Can you share your page code for that?  This is where I am having problems,
> it seems as though doing things in SQL is harder than text...  If you could
> give code snippets of SQL based searches and other ways you access the data
> that would be great!!!
> 
> Does anyone have external/helper perl scripts accessing mySQL data?  I have
> a couple using the text files, but when upgrading to mySQL I want to still
> use them...
> 
> Thanks,
> 
> Russ
> 
> -----Original Message-----
> Sent: Wednesday, July 07, 1999 10:01 AM
> To: minivend-users@minivend.com
> Subject: Re: makecat templates
> 
> 
> ******    message to minivend-users from Erik Aase-Remedios
> <erik@fourfish.com>     ******
> 
> As far as makecat goes my MySQL/Minivend config isn't any different than a
> non-MySQL makecat config.
> The only real difference comes in the configuration file 'catalog.cfg' in
> the Database section.
> I use this:
>   Database  products     products.asc     dbi:mysql:db_name:localhost:3306
>   Database  products     LongReadLen      128
>   Database  formats      formats.asc      dbi:mysql:db_name:localhost:3306
>   ... one line for each table ...
> 
> And I use NoImport on all of my tables.
>   NoImport products formats ...
> 
> The real changes come in the page templates where I'm using SQL searches
> and lots of SQL lookups to deal with a complex table structure.
> 
> -Erik
> 



Search for: Match: Format: Sort by: