MiniVend Akopia Services

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

Re: Please Help: How to use minivend variable like [item-code] in a SQL search string?



******    message to minivend-users from Dan Busarow <dan@dpcsys.com>     ******

On Wed, 17 Feb 1999, Tim Murphy wrote:
> I've been stumped by this since Day 1. Is there any way to get a Minivend
> variable to
> be interpolated inside a SQL string? To wit:
> 
> <IMG SRC=[[sql param]select image from db where code = '[item-code]'[/sql]]>
> 
> What I'm trying to do is pull the image filename out of a mySQL database for
> its
> associated item to use in a flypage. The above returns nada, and it seems
> that
> [item-code] never gets interpolated. If I remove the single quotes it causes
> the
> page to generate an Internal Server Error. Am I missing something, is there
> a
> better way to do it, or is this just not possible under Minivend 3.10?

You're working too hard :)

Here's a piece from one of our flypages that also uses mysql.

<table border=0 width=75%>
<tr>
<th rowspan=2 valign=top>
<IMG SRC="[item_field image]">
<P>
<td>
<H2>[item-description]</H2>
[item_field longdescription]
<tr>
<th>
Price: $[item-price 1]
...

For non-flypages, where we're using other tables

[compat]
[comment]        0     1      2    [/comment]
[sql list select name, image, longdescription from subcategories where code = '[
[perl]
$a = tag_data('session', 'arg');
return $a;
[/perl]]']

<table border=0 width=75% cellpadding=7 cellspacing=7>
<tr>
<th><img src="[sql_param 1]"></th>
<td><b>[sql_param 2]</b></td>
</tr>
</table>
[/sql]
[/compat]

Note the [compat]

Dan
-- 
 Dan Busarow                                                  949 443 4172
 Dana Point Communications, Inc.                            dan@dpcsys.com
 Dana Point, California  83 09 EF 59 E0 11 89 B4   8D 09 DB FD E1 DD 0C 82

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