[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] SQL backed site exclusively??
****** message to minivend-users from "Nick Pleis" <npleis@cei.net> ******
It is very possible to do regular SQL queries directly from minivend.
It goes something like (this is coming from memory, so no guarantees that it
is right):
[sql type=list
query="SELECT * FROM whatever"]
do your sql stuff here, you can access particular fields within each record
with [sql-param field_name]
[/sql]
it will loop through each returned record within the [sql] tags...
Just to show it can be done....:)
Nick Pleis
-----Original Message-----
From: Mark Stosberg <mark@summersault.com>
To: minivend-users@minivend.com <minivend-users@minivend.com>
Date: Sunday, February 27, 2000 1:05 PM
Subject: Re: [mv] SQL backed site exclusively??
>****** message to minivend-users from Mark Stosberg
<mark@summersault.com> ******
>
>
>Hello Robert, I think I remember you from a Links SQL Bulletin Board.
>
>Even with Minivend's 4.0 edition it's clear it roots are in a flat file
>based system that added on SQL support. For example look at this
>documentation on SQL searches:
>http://www.minivend.com/minivend/docindex/11.07.SQL_searches.html
>
>It shows how to use Minivend variables to generate a SQL query:
>
><snip>
>The following search will find all Van Gogh paintings that are between
>$1,000,000 and $20,000,000, providing the price field is a numeric data
>type. It also illustrates the use of some other MiniVend variables that
>are usable for SQL searches.
>
> <FORM METHOD=POST ACTION="[process-search]">
> <INPUT TYPE=hidden NAME=mv_searchtype VALUE="sql">
> <INPUT NAME=mv_searchspec VALUE="Van Gogh">
> <INPUT TYPE=hidden NAME=mv_search_field VALUE="artist">
> <INPUT TYPE=hidden NAME=mv_range_look VALUE="price">
> <INPUT TYPE=hidden NAME=mv_range_min VALUE="1000000">
> <INPUT TYPE=hidden NAME=mv_range_max VALUE="20000000">
> <INPUT TYPE=hidden NAME=mv_return_fields VALUE="code,description">
> <INPUT TYPE=hidden NAME=mv_sort_field VALUE="price">
> <INPUT TYPE=hidden NAME=mv_sort_option VALUE="r">
> </FORM>
>
>It will generate the query:
>
> SELECT code, description FROM products WHERE artist = 'Van Gogh'
> AND price >= 1000000 AND price <= 20000000
> ORDER BY price DESC
></snip>
>
>Since I already know SQL, the SQL looks straight forward, but the
>Minivend language looks rather confusing. What's been frustrating for me
>that it appears I have to use the Minivend system instead of just using
>the straightforward SQL. But that's for another day... here's an answer
>to your question about SQL tables.
>
>First you need to set you for Catalog.cfg file as described here:
>http://www.minivend.com/minivend/docindex/08.02.SQL_support_via_DBI.html
>
>Second, you need to make some empty ASCII files if even you aren't going
>to use them. I find this to be a pain, but c'est la via.
>
>For example, if you have this defined in Catalog.cfg:
>
>Database arbitrary arbitrary.asc dbi:mSQL:minivend:localhost:1114
>
>then you need to populate a table named arbitrary.asc in your products
>directory that contains a single line with a deliminated listing of all
>the column names in the catalog, in the order you want them to appear in
>the database.
>
>Third, when you restart the server, minivend will create a tablename.sql
>file in the products directory for each file it tries to import. Once a
>.sql file has been created, it won't try to import anymore. Be careful
>though, when Minivend creates tables this way, it drops the existing
>table first! If you already have existing tables set up, this isn't the
>solution for you.
>
>Perhaps look at the "NoImport" directive.
>
>You also revisit the source code of the 4.0 beta series, which contains
>the SQL definitions needed for running a minivend store entirely off of
>a mysql. (in the simple/mysql directory I think).
>
>Good luck,
>
> -mark
>
>Pugdog wrote:
>>
>> ****** message to minivend-users from Pugdog <pugdog@ibm.net>
******
>>
>> I'm a little dense sometimes -- I guess it comes from my early
>> line-oriented initiation into computers and programming. I really need
to
>> start at the beginning, and MV is so complex it seems to always want to
>> start you off in the middle. I feel I'm missing something very, very
basic.
>>
>> I'm no stranger to beta software, and wanted to use MV4 beta to get at
the
>> new features. I had to finally give up with beta2 release because there
>> are some config problems I just can't get past... The "simple" catalog
>> wouldn't work at all -- undefined arrays and such. The basic catalog
>> would work, but the user/sessions stuff wouldn't, so until more people
>> start using it, I guess it's on hold for me.
>>
>> I dropped back to MV 3.14-5, and still need to use SQL to hold the
>> databases and data. Most of my data is already in SQL format.
>>
>> I'm really, really confused on what MiniVend is doing with the databases.
>>
>> If the data is in the SQL database, does MiniVend use ASCII tables at
all?
>>
>> How would I define this in a config file?
>>
>> Is there a list somewhere of the bare minimum SQL tables and fields that
>> MiniVend requires? And a matching catalog config? The demo config files
>> seem to have a lot of extra items in there to handle different cases.
I'm
>> finding it really confusing trying to figure out what is needed to run it
>> as a MySQL backed shop.
>>
>> I would really like to do everything in MySQL/SQL and not have to
>> use ASCII uploads at all -- this is even for importing data into the
>> databases. I'd rather do it directly in an SQL query than with ASCII
uploads.
>>
>> Thanks for any insights,
>>
>> Robert S. Pataki, MD
>> President, PUGDOG Enterprises, Inc.
>> http://www.postcards.com
>>
>> -
>> 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
>
>--
> <<-------------------------------------------------------------->>
>personal website < Summersault Website Design
> http://mark.stosberg.com/ > http://www.summersault.com/
>-
>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
>
-
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