Hi,

This is rather a Perl DBI question than a MySQL one.

I have recently upgraded a MySQL 3.23 server to 4.0. It resulted in some of my queries (issued using Perl DBI) starting to fail. It turned out to be that queries like
$sth = $dbh->prepare("SELECT whatever FROM something WHERE anything LIMIT ?,?");
$sth->execute(1,2);
are no longer working ("...you have an error in your query..."). However, this works:
$sth = $dbh->prepare("SELECT whatever FROM something WHERE anything LIMIT 1,2");
$sth->execute;
so the problem is with the placeholders in the LIMIT clause.


Interestingly, other placeholders not in the LIMIT part work. For example
$sth = $dbh->prepare("SELECT whatever FROM something WHERE anything=?");
$sth->execute(123);
and
$sth = $dbh->prepare("SELECT whatever FROM something WHERE anything=? LIMIT 1,2");
$sth->execute(123);
are OK.


Any ideas what causes this behaviour? Maybe I have not upgraded my DBI & DBD packages properly? Or are LIMIT placeholders no longer supported in DBI with MySQL 4?

Thanx,
- Fagyal Csongor


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to