MiniVend Akopia Services

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

Q: how to do a simple counter loop?



******    message to minivend-users from "Alan Sparks" <asparks@nss.harris.com>     ******

OK, I've just wasted a couple hours on this, I just don't get it...

I need to run a counter while I go through a [sql] loop.  Basically, I want
to do this:

$i = 0
[sql type=list query="select ..."]
  stuff and nonsense...
  ++$i
[/sql]
if $i == 0 then
  there was nothing in the database

I've tried various combos of [calc] (bad since the values show in the page)
and [if explicit] (which seems to come out false or true invariably).

Is there a standard idiom for running a counter and testing it in this
circumstance?  I couldn't find it in the list archive.

Thanks for any advice.
-Alan

=============
Alan Sparks, IS Engineering Support
<asparks@nss.harris.com>
Harris Communications, Camarillo CA                   (805) 389-2430

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