in reply to
Re: Trouble updating value of variable for a placeholder
in thread Trouble updating value of variable for a placeholder
I found a bug report on the web and a workaround solution. Thought some people might want to know this.
my $sth = $dbh->prepare('SELECT * FROM applicant WHERE date_col = ? OR
+DER BY job_position LIMIT ?,10');
$sth->bind_param(2, $limit, DBI::SQL_INTEGER);
$sth->execute($date,$limit) or die $sth->errstr;
Sometimes when using placeholders, especially for LIMIT, the DBD gets a little confused on what type of value it's being given. Line 2 binds the string $limit to an integer value. The "2" in the parenthesis is telling it the second string in the 'execute'. If you needed it for the first string it would be sth->bind_param(1, $date, DBI::SQL_INTEGER);
Hey it worked for me. Maybe it can help someone else out.