List:MySQL and Perl« Previous MessageNext Message »
From:Jochen Wiedmann Date:March 5 2004 9:49am
Subject:Re: LIMIT clause and placeholders
View as plain text  
Beau E. Cox wrote:

> my $sth = $dbh->prepare("select * from some_table limit ?");
>   OK
> $sth->execute(10);
>   same syntax error as with 'mysql'

It would probably work by using $sth->bind_param and specifying
the type. (DBD::mysql contained an incompatbile change that
made all anonymous placeholders strings by default.)

However, using a placeholder for the LIMIT clause cannot be
recommended anyways: It is not portable and perhaps even not
upwards compatible, if at some point the DBD::mysql driver
uses server side placeholders.


Jochen

Thread
LIMIT clause and placeholdersBeau E. Cox5 Mar
  • Re: LIMIT clause and placeholdersJochen Wiedmann5 Mar
    • Re: LIMIT clause and placeholdersTim Bunce5 Mar
    • Re: LIMIT clause and placeholdersBeau E. Cox5 Mar
      • Re: LIMIT clause and placeholdersRudy Lippan5 Mar
        • Re: LIMIT clause and placeholdersBeau E. Cox5 Mar
          • Re: LIMIT clause and placeholdersRudy Lippan6 Mar
            • Re: LIMIT clause and placeholdersBeau E. Cox6 Mar
        • Re: LIMIT clause and placeholdersJochen Wiedmann5 Mar
          • Re: LIMIT clause and placeholdersGarth Webb5 Mar
            • Re: LIMIT clause and placeholdersGarth Webb5 Mar
              • Re: LIMIT clause and placeholdersDaniel Koch5 Mar
              • Re: LIMIT clause and placeholdersJochen Wiedmann5 Mar
            • Re: LIMIT clause and placeholdersJochen Wiedmann5 Mar
          • Re: LIMIT clause and placeholdersRudy Lippan6 Mar