2010/7/9 M <[email protected]>:
> I'm sorry to bother you with this, but I'm having some trouble with what
> was a working template. The server version is running fine on TT 2.20 and
> Template-DBI-2.65 (I think)

I'm interested where you got this version. Maybe this is an initial hint whom
to ask for assistance. There is no public release for Template-DBI-2.65

> but when installed on my netbook with Template-Toolkit-2.22 and
> Template-DBI-2.64 things go wrong.
>
> The bit of template that seems to be failing looks like this.
[cut for clarity]

> Now when the active array passed through from the perl script is empty
> this fails with
>
> DBI error - execute failed: called with 1 bind variables when 0 are needed
>
> If there's one item in the active array then it doesn't fail, but also
> doesn't seem to be passing anything meaningful through to the mysql server
> as nothing gets returned (my suspicion is it passes an array ref)
>
> If active holds 2 or more you get
>
> DBI error - execute failed: called with 1 bind variables when n are needed
>
> where n is the number passed.
>
> Thus it seems to me that rather than passing a list of vars with the
>
>                [% FOREACH customer = main.execute(bind) %]
>
> I'm passing one, which as I said above I assume is a ref to the array.
>
> So how do I deref this array, and why do I now need to.

I've added a test in Template-DBI-2.64_02 (see t/dbi.t lines 197 ..
206) to prove
this. As expected: User error - things are fine in Template-DBI.

You can take a look how it's been done.

Best regards,
Jens

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to