Akopia Akopia Services

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

Re: [mv] late in the day help - looping from vars



******    message to minivend-users from cfm@maine.com     ******

On Wed, Jun 21, 2000 at 05:10:14PM +0100, Adam Kett wrote:
> ******    message to minivend-users from Adam Kett <adam@opusvl.com>     ******
> 
> 
> I have a problem........ but apart from that I was wondering If anyone can help me with
> the following syntax possibles
> 
> i need to be able to loop a section of code with in a MV page
> 
> such as
> 
> for (1..[value total_counter])
>   [scratch sql-selects-writes-rm]
> 
> 
> what I am trying to do is
> 
>     1) select a specific line of info from a mysql table grouped by a code
>     2) set all the needed info from it in to vars
>     3) Write those vars into a different table
>     4) rm item from soucre table
>     5) blank vars
>     6) repeat for next item till there are none


Minivend can't handle that directly.  Think of each page more or less as a
snapshot, not a proceedure.  All of the data has to be present in the environment
for that page, then the [tags] can be used to rearrange it.

If you need proceedure you need to use perl and build your routine (well, yeah
you could use awk | mysql | grep ) and dump the output of that call into
the page.


> 
> problems
> 
> each amount of items are not a fixed amount so there is no static shortcuts :(
> 
> can not do a joined select/insert through mysql :(
> 
>  can not place sql within sql :(

mysql can't do that anyway or maybe I misread.
> 
>  not that well versed in perl :(   (not yet anyway and need this soon, hence can not do back end
> script at mo)

Sometimes you can massage your data in advance to simplify the query.
You can get fancy with redirects to "drill down" but that can be slow.
Otherwise get well versed or redefine the concept.

Been there.  ;^)

cfm

-- 

Christopher F. Miller, Publisher                             cfm@maine.com
MaineStreet Communications, Inc         208 Portland Road, Gray, ME  04039
1.207.657.5078                                       http://www.maine.com/
Database publishing, e-commerce, office/internet integration, Debian linux.
-
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: