[ic] sql-param macro question

Jon Jensen jon at endpoint.com
Fri Jul 29 22:28:22 EDT 2005

On Fri, 29 Jul 2005, jeff at hisgirlfridays.com wrote:

> I know this is probably pushing it with ITL, but:
> - given a database table column named "price1"
> - and [tmp macro]price1[/tmp]
> is there a way to do [sql-param [scratch macro]] (where I actually want
> it to be interpreted as [sql-param price1])?

I can't think of any way offhand using only the scratch variable, but you 
could do it like this:

[loop prefix=field lr=1 list="[scratch macro]"]
[query sql="..." list=1]

blah blah [field-code] blah blah


That's untested, but I think it will work.

If you have more than one variable you need interpolated, you can just add 
columns to the pseudo-query result in the loop list, and refer to the 
others as [field-pos 1], etc. When I've done this before, I've started the 
"variables" loop at or near the top of the page, so that those values are 
available throughout the page.

> Also, we are launching a nice, new IC site at store.charmschool.com this
> week.  It came out good, very happy with it.  We are also doing a spring
> break vacation packages site which is extremely exciting for me.  We are
> not using any of the provided IC templates for it, the whole frontend
> and admin is custom-built. I decided to use IC because it's already
> running numerous ecommerce sites on our server and I knew that its
> session management system is superb.  Of course, with the query and list
> tags you can easily store and retrieve dynamic content.  When I went to
> implement image uploads on the admin, and discovered that just one line
> of code handled it all (value-extended), I knew that my choice to use IC
> for content management was well made.  Proves what I've been saying for,
> like, five years - IC is way more than just a shopping cart, it's a web
> application framework.

Congratulations on the new site! I have also found Interchange to work 
nicely for numerous non-shopping applications.


Jon Jensen
End Point Corporation

More information about the interchange-users mailing list