[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
RE: Database: can't update database record (Solution)
****** message to minivend-users from "Yossi Cohen" <YOSSI@prodigy.net> ******
Mike,
No need to get upset (if I understood your reaction). I decided to spare
some time to search the documentation for the obvious differences between
the [loop-field ...] and [loop-data ...] tags. Honestly, I could not find
any references. Actually one example which I found to be probably the most
confusing was this:
>>
[compat]
[loop 1 2 3]
[loop-a 1 2 3 ]
[loop-b 1 2 3]
[loop-code].[loop-code-a].[loop-code-b]
[/loop-b]
[/loop-a]
[/loop]
[/compat]
All loop items in the inner loop-a loop need to have the with value
appended, i.e. [loop-field-a name], [loop-price-a], etc. Nesting is
arbitrarily large, though it will be slow for many levels.
<<
which suggests that you can use loop-field to access any arbitrary database.
Also this one:
>>
[loop-field fieldname]
Evaluates to the field name fieldname in the database, for the current item.
<<
doesn't specifies precisely that it works with only the products database.
But anyway, that's not the point.
I noticed in the past that a lot of the questions to the list resulted from
the inconsistencies among the various database access tags (such as
[loop-field ...] or [item-field ...]).
I can understand there are cases programmatically where deviation from a
"base class" is required if a particular functionality is needed to
accommodate specific requirement. But I also think that when possible the
user should be able to access methods in the derived class the same way
("overloading") as in the base class.
In MiniVend, I wish you could find a way, by either having more arguments,
or whatever, to aggregate common tags into one. Whether is would be possible
to have the same magic [loop-field ...] behavior embedded into [loop-data
products magic=1 ...] or not it is up to you to decide.
Mike, I am not complaining. I'm only trying to suggest possible solution to
some confusion that users have.
My apology if I am completely of.
Yossi
-----Original Message-----
From: owner-minivend-users@minivend.com
[mailto:owner-minivend-users@minivend.com]On Behalf Of
mikeh@minivend.com
Sent: Sunday, March 07, 1999 5:52 PM
To: minivend-users@minivend.com
Subject: Re: Database: can't update database record (Solution)
****** message to minivend-users from mikeh@minivend.com ******
Quoting Yossi Cohen (YOSSI@prodigy.net):
>
> Hi,
>
> [loop-field] tag works with the products database only (that's a bit
> inconsistent behavior which I hope will be resolved in future versions of
> Minivend.
This a constant misconception which I don't know what to do to
correct; I can't stand to see it any more. Several people have corrected
this on the mail list before, and I know it is documented. I should
do an FAQ, I guess. Sigh....
[loop-field column] != [loop-data products column]
The following are all "magic":
[item-field column]
[loop-field column]
[sql-field column]
[field column key]
They find the column in the FIRST ProductsFile that matches
the item, or in the case of the [item-list] tag with [item-field],
the column from the database it is ordered in.
So if you have two databases:
Database new new.asc TAB
Database used used.asc TAB
ProductFiles new used
and you do:
[order 00-0011] Order the frame [/order]
it will select a used one if a new one is not available.
Furthermore, the same item-list:
[item-list] [item-code]: [item-field description]
[currency][item-field price][/currency]
[/item-list]
can be used to display items from both the new and used database
together, with auto-selection.
This allows multiple product lines in multiple databases to
be aggregated while still sharing a common shopping cart, results
page, and other data items.
--
Mike Heins http://www.minivend.com/ ___
Internet Robotics |_ _|____
Fast, reliable, cheap. 131 Willow Lane, Floor 2 | || _ \
Pick two and we'll talk. Oxford, OH 45056 | || |_) |
-- unknown <mikeh@minivend.com> |___| _ <
513.523.7621 FAX 7501 |_| \_\
-
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