in reply to My DBI suddenly can't handle placeholders in a LIMIT clause.

You often need to do things like this with DBD::SQLite too. SQLite only does strings, but if you pass a number to the $sth->execute() method it gets terribly confused. An easier work-around though than explicitly passing the type is to say $sth->execute('' . $number).

Maybe $sth->execute(0 + $number) will convince DBD::Mysql in your case.

Replies are listed 'Best First'.
Re^2: My DBI suddenly can't handle placeholders in a LIMIT clause.
by Cap'n Steve (Friar) on Aug 11, 2007 at 04:42 UTC
    Actually, doing math with the variable doesn't help. Perl must know it's a number but something in the database driver causes it to forget.