in reply to Re: DBI Placeholders
in thread DBI Placeholders

Forgot to mention one thing - you need to change the prepare function to prepare_cached otherwise the ? will cause it to fail.

-Adam Stanley
Nethosters, Inc.

Replies are listed 'Best First'.
Re: Re: Re: DBI Placeholders
by knobunc (Pilgrim) on Apr 10, 2001 at 01:14 UTC

    Nah, prepare is fine. The prepare_cache just saves the corresponding $sth. This may be faster depending on the DB, but as the docs note it may be risky.

    -ben

      To clarify, DBI takes care of saving the $sth. You don't have to worry about it. From the doc:
      Like prepare except that the statement handle returned will be stored +in a hash associated with the $dbh. If another call is made to prepar +e_cached with the same $statement and %attr values, then the correspo +nding cached $sth will be returned without contacting the database se +rver.
      So you go on about your business and let DBI worry the details.