Search code examples
zend-framework

Purpose of $db_adapter->prepare();


What is the purpose of $db_adapter->prepare() in Zend Framework 1?

Here is the sample code:

$db_adapter->prepare($sqlstring);

Here $sqlstring is the variable that stores the MySQL select query.


Solution

  • prepare in ZF1 adapters is the same as prepare in PDO. It prepares the given sql string for its execution in the context of a prepared statement.