[ic] Using username to search another table

Webpraxis Consulting Ltd. interchange-users@icdevgroup.org
Thu Oct 24 10:11:37 2002


At 09:17 AM 10/24/02 -0400, you wrote:
>I'm trying to use username from userdb as the search string for another
>database.  I'm doing this in an attempt to add multiple shipping addresses
>in a seperate database.  Here is the last attempt I've made:
>
>[calc]$Config->{NoSearch} = ''[/calc]
>   [if data shiptos::username::[data session username]]
[snip]
>This doesn't work, and I get this error in error.log:
>
>192.168.1.250 dXY5WICp:192.168.1.250 - [24/October/2002:21:13:23 -0400] dev
>/cgi-bin/dev/process.html Bad if 'data shiptos::username::[data session
>username': syntax error at (eval 457) line 2, near "q{} session username
>
>I've searched the mail archives, but no luck.  Any shove towards the proper
>documentation, or any thoughts on what's going wrong would help me a ton!!!

Quoting from the 'Template Guide', page 14, 1st paragraph:
"If another tag is needed to select the key, and it is not a looping tag
construct, named parameters must be used".
So try
[if type=data term="shiptos::username::[data session username]"]
This construct forces interpolation of the inner tag which, in Perl-speak,
means using qq{} instead of q{}.
Cheers,

Yves Beaudoin, Ph.D., President,
Webpraxis Consulting Ltd.,
Edmonton, Alberta, Canada, T5R 5S5
E-mail: post@webpraxis.ab.ca

Owner of the Virtual Railroad:
www.webpraxis.ab.ca/vrr/