/**
* Prepares an SQL statement.
*
* @param string $sql The SQL statement with placeholders.
* @param array $bind An array of data to bind to the placeholders.
* @return PDOStatement
*/
public function prepare($sql) { $this->
_connect();
$stmtClass =
$this->_defaultStmtClass;
if (!
class_exists($stmtClass)) { Zend_Loader::
loadClass($stmtClass);
} $stmt =
new $stmtClass($this,
$sql);
$stmt->
setFetchMode($this->_fetchMode
);
return $stmt;
} /**
* Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.
*
* As a convention, on RDBMS brands that support sequences
* (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence
* from the arguments and returns the last id generated by that sequence.
* On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method
* returns the last value generated for such a column, and the table name
* argument is disregarded.
*
* On RDBMS brands that don't support sequences, $tableName and $primaryKey
* are ignored.
*
* @param string $tableName OPTIONAL Name of table.
* @param string $primaryKey OPTIONAL Name of primary key column.
* @return string
*/