Akopia Akopia Services

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

Re: [mv] Query usage



******    message to minivend-users from Mike Heins <mikeh@minivend.com>     ******

Quoting Nick Pleis (npleis@saratogaweb.com):
> Hey,
> 
> I'm wanting to have some HTML that only shows up if a particular query returned something. For example:
> 
> [query sql="select * from foo" list=1]
> heres some stuff that should only show up in the query
> [list]
> [sql-param something]
> [/list]
> [/query]
> 
> I had hoped that the method above would achieve this, however...the text
> within the query tag is parsed and used even if the query itself was empty.
> Is there some way to determine how many rows a query returned to encapsulate
> this within some sort of conditional expression?
> 

Does this array of features not work for you? 

[query list=1 sql="select * from products where artist like '%gogh%'"]

    This is the unvarying text, displayed whether there are matches or not.

[list]

    [sql-change 1][condition]1[/condition]
         <blockquote> This will get shown once if there is a match. </blockquote>
    [/sql-change 1]

    This is shown for every match:<br>
    title: [sql-param title]<P>

[/list]

[no-match]
    <blockquote>This only gets displayed if there is no result. </blockquote>
[/no-match]

[/query]

I could see that there might be an opening for an [on-match] pair, which
could provide easy header/footer capability.

-- 
Akopia, Inc., 131 Willow Lane, Floor 2, Oxford, OH  45056
phone +1.513.523.8220 fax 7501 <heins@akopia.com>

Clothes make the man.  Naked people have little or no influence on
society.  -- Mark Twain
-
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: