MiniVend Akopia Services

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

RE: Setting up Mysql Part I



******    message to minivend-users from Dan Busarow <dan@dpcsys.com>     ******

On Thu, 14 Jan 1999, Darren Littlejohn wrote:
> I commented out the default products.asc file and uncommented the mysql dbi
> line, created
> a database called minivend in mysql, and restarted minivend. To my
> surprise, minivend AUTOMATICALLY created the products database in Mysql!

I mentioned that somewhere else in the message you quoted:

=======
> What is the text file for if you're importing from a mysql database? Where

You can build your mysql table from data in the flat file.  I see this
as a good way to shoot yourself but others find it useful.  Set

NoImport products any_other_dbi_tables

to protect yourself from this possibly surprising feature.
=======

So you must have missed the NoImport directive.

> That's all super groovy and everything, but I don't have the slightest clue
> as to how it happened. Here's the point where I'm at now: I've been working
> on this for 2 weeks, and am still at a loss for
> how to make my own database work with minivend. The docs are very
> confusing. But at least now I know that all the components are working
> together, ie Perl, DBI, Apache, Mysql, and Minivend. That was hard enough!
> Now my goal is to be able to add fields to the existing products database
> that was autocreated off the demo template, and to figure out how that
> connects to the actual HTML page, and what I put in the HTML\MV page to
> make it access the new Mysql fields. 
> Am I making this too hard? Normally I can kick butt on new things, but this
> one's been very difficult. Do you have any tips?

I'd suggest that you leave things alone (field wise) and experiment with
SQL lookups and searches using the standard product database.  Once you
get the hang of MV and SQL then you can create your own tables.

You might be surprised to find that MV is already working and using
your mysql data for the demo store.  Change some descriptions in
mysql and check it out.

But the first thing you want to do is turn on  NoImport so you don't
accidently trash your data by editing products.asc.

Later you can drop the standard products table, create your own (but
use the same field names, like code for the sku and description for
the description, for existing fields) and try again.  Leave "code" as
the first field in the products table too.  Hey, it still works, with
no changes to the HTML.

At this point you can start using your new fields with [item_field fieldname]
and [item_data database fieldname] tags.

Finally, start writing your own queries, [sql list] seems to be the
easiest to use so I'd suggest starting with that.  Use [sql_param N]
instead of [item_field] in sql result sets.

Dan
-- 
 Dan Busarow                                                  949 443 4172
 Dana Point Communications, Inc.                            dan@dpcsys.com
 Dana Point, California  83 09 EF 59 E0 11 89 B4   8D 09 DB FD E1 DD 0C 82

-
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: