Re: DBD::mysql::st bind_param failed: Illegal parameter number

Chad Wallace <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.general
Organization The Lodging Company
Message-ID <[email protected]>
On Fri, 10 Aug 2012 17:08:07 -0400
Rudolf Lippan <[email protected]> wrote:

> On Friday, August 10, 2012 at 03:30:16 PM, Seven Reeds wrote:
> >     $tmp = <<EOF;
> > SELECT
> >     UPPER(eS.machine) AS Machine,
> >     UPPER(eS.netID) AS NetID,
> >     DATE_FORMAT(eS.date, '%Y/%m/%d %H:%i:%S') AS Start,
> >     IF (eE.date IS NULL,
> >         '',
> >         DATE_FORMAT(eE.date, ''%Y/%m/%d %H:%i:%S')) AS End,
>                                                      ^^^^^^
> ...
> 
> > ideas?
> > 
> 
> 
> Unless I am missing something,  it looks like your SQL is broken.

Specifically, the doubled-up single-quote before the date format
string.  I think your caret pointers ended up a little off.

With the doubled-up quote, the quoting through the rest of the query
gets inverted--meaning your question marks all end up inside quotes,
and aren't recognized as placeholders.

It would be great if that would trigger a syntax error.... but the
checking for that probably doesn't happen until later, when execute is
called.

-- 

C. Chad Wallace, B.Sc.
The Lodging Company
http://www.lodgingcompany.com/
OpenPGP Public Key ID: 0x262208A0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.