Akopia Akopia Services

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

Re: [mv] revisiting conditional display on Query



******    message to minivend-users from jojo@buchonline.net     ******

On 31 Jul, Nick Pleis wrote:
> I had previously asked a question about how to display a set of information only if the query returned actual results. I received an answer telling me to do this:
> 
> [query sql="select * from foo" list=1]
> [seti display][sql-code][/seti]
> 
> [if scratch display]
> stuff only shows if query returned results
> [/if]
> 
> [list]
> query stuff
> [/list]
> [/query]
> 
> 
> However, interestingly enough this doesn't seem to work. Upon examining the contents of display..it actually contains the text "[sql-code]" which suggests that it was never interpolated, maybe because the sql container isn't valid yet. This is a problem:) 
> 
> Does anyone have any other suggestions as to how to make this work?
> 
> Nick

Try

 [query sql="select * from foo" list=1]
 [seti display][sql-param code][/seti]
 
 [if scratch display]
 stuff only shows if query returned results
 [/if]
 
 [list]
 query stuff
 [/list]
 [/query]


This works for me:

[query
	list=1
	st=db
	sql=|
		SELECT * FROM orderline
		WHERE sku = '[item-code]'
	|
]
[seti test][sql-param sku][/seti]
[/query]

Joachim


-- 
Hans-Joachim Leidinger
buch online                 jojo@buchonline.net
Munscheidstr. 14            FAX: +49 209 1671449
45886 Gelsenkirchen         FAX: 0209 1671449

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