PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Notes on Specific Adapters

This section lists differences between the Adapter classes of which you should be aware.

IBM DB2

  • Specify this Adapter to the factory() method with the name 'Db2'.

  • This Adapter uses the PHP extension IBM_DB2.

  • IBM DB2 supports both sequences and auto-incrementing keys. Therefore the arguments to lastInsertId() are optional. If you give no arguments, the Adapter returns the last value generated for an auto-increment key. If you give arguments, the Adapter returns the last value generated by the sequence named according to the convention 'table_column_seq'.

MySQLi

  • Specify this Adapter to the factory() method with the name 'Mysqli'.

  • This Adapter utilizes the PHP extension mysqli.

  • MySQL and MariaDB do not support sequences, so lastInsertId() ignores its arguments and always returns the last value generated for an auto-increment key. The lastSequenceId() method returns NULL.

Oracle

  • Specify this Adapter to the factory() method with the name 'Oracle'.

  • This Adapter uses the PHP extension oci8.

  • Oracle does not support auto-incrementing keys, so you should specify the name of a sequence to lastInsertId() or lastSequenceId().

  • The Oracle extension does not support positional parameters. You must use named parameters.

  • Currently the Zend_Db::CASE_FOLDING option is not supported by the Oracle adapter. To use this option with Oracle, you must use the PDO OCI adapter.

  • By default, LOB fields are returned as OCI-Lob objects. You could retrieve them as string for all requests by using driver options 'lob_as_string' or for particular request by using setLobAsString(boolean) on adapter or on statement.

Microsoft SQL Server

  • Specify this Adapter to the factory() method with the name 'Sqlsrv'.

  • This Adapter uses the PHP extension sqlsrv

  • Only Microsoft SQL Server 2005 or greater is supported.

  • Microsoft SQL Server does not support sequences, so lastInsertId() ignores primary key argument and returns the last value generated for an auto-increment key if a table name is specified or a last insert query returned id. The lastSequenceId() method returns NULL.

  • Zend_Db_Adapter_Sqlsrv sets QUOTED_IDENTIFIER ON immediately after connecting to a SQL Server database. This makes the driver use the standard SQL identifier delimiter symbol (") instead of the proprietary square-brackets syntax SQL Server uses for delimiting identifiers.

  • You can specify driver_options as a key in the options array. The value can be a anything from here http://msdn.microsoft.com/en-us/library/cc296161(SQL.90).aspx.

  • You can use setTransactionIsolationLevel() to set isolation level for current connection. The value can be SQLSRV_TXN_READ_UNCOMMITTED, SQLSRV_TXN_READ_COMMITTED, SQLSRV_TXN_REPEATABLE_READ, SQLSRV_TXN_SNAPSHOT or SQLSRV_TXN_SERIALIZABLE.

  • As of Zend Framework 1.9, the minimal supported build of the PHP SQL Server extension from Microsoft is 1.0.1924.0. and the MSSQL Server Native Client version 9.00.3042.00.

PDO for IBM DB2 and Informix Dynamic Server (IDS)

  • Specify this Adapter to the factory() method with the name 'Pdo_Ibm'.

  • This Adapter uses the PHP extensions PDO and PDO_IBM.

  • You must use at least PDO_IBM extension version 1.2.2. If you have an earlier version of this extension, you must upgrade the PDO_IBM extension from PECL.

PDO Microsoft SQL Server

  • Specify this Adapter to the factory() method with the name 'Pdo_Mssql'.

  • This Adapter uses the PHP extensions pdo and pdo_dblib.

  • Microsoft SQL Server does not support sequences, so lastInsertId() ignores its arguments and always returns the last value generated for an auto-increment key. The lastSequenceId() method returns NULL.

  • If you are working with unicode strings in an encoding other than UCS-2 (such as UTF-8), you may have to perform a conversion in your application code or store the data in a binary column. Please refer to Microsoft's Knowledge Base for more information.

  • Zend_Db_Adapter_Pdo_Mssql sets QUOTED_IDENTIFIER ON immediately after connecting to a SQL Server database. This makes the driver use the standard SQL identifier delimiter symbol (") instead of the proprietary square-brackets syntax SQL Server uses for delimiting identifiers.

  • You can specify pdoType as a key in the options array. The value can be "mssql" (the default), "dblib", "freetds", or "sybase". This option affects the DSN prefix the adapter uses when constructing the DSN string. Both "freetds" and "sybase" imply a prefix of "sybase:", which is used for the FreeTDS set of libraries. See also http://www.php.net/manual/en/ref.pdo-dblib.connection.php for more information on the DSN prefixes used in this driver.

PDO MySQL

  • Specify this Adapter to the factory() method with the name 'Pdo_Mysql'.

  • This Adapter uses the PHP extensions pdo and pdo_mysql.

  • MySQL and MariaDB do not support sequences, so lastInsertId() ignores its arguments and always returns the last value generated for an auto-increment key. The lastSequenceId() method returns NULL.

PDO Oracle

  • Specify this Adapter to the factory() method with the name 'Pdo_Oci'.

  • This Adapter uses the PHP extensions pdo and pdo_oci.

  • Oracle does not support auto-incrementing keys, so you should specify the name of a sequence to lastInsertId() or lastSequenceId().

PDO PostgreSQL

  • Specify this Adapter to the factory() method with the name 'Pdo_Pgsql'.

  • This Adapter uses the PHP extensions pdo and pdo_pgsql.

  • PostgreSQL supports both sequences and auto-incrementing keys. Therefore the arguments to lastInsertId() are optional. If you give no arguments, the Adapter returns the last value generated for an auto-increment key. If you give arguments, the Adapter returns the last value generated by the sequence named according to the convention 'table_column_seq'.

PDO SQLite

  • Specify this Adapter to the factory() method with the name 'Pdo_Sqlite'.

  • This Adapter uses the PHP extensions pdo and pdo_sqlite.

  • SQLite does not support sequences, so lastInsertId() ignores its arguments and always returns the last value generated for an auto-increment key. The lastSequenceId() method returns NULL.

  • To connect to an SQLite2 database, specify 'sqlite2' => true in the array of parameters when creating an instance of the Pdo_Sqlite Adapter.

  • To connect to an in-memory SQLite database, specify 'dbname' => ':memory:' in the array of parameters when creating an instance of the Pdo_Sqlite Adapter.

  • Older versions of the SQLite driver for PHP do not seem to support the PRAGMA commands necessary to ensure that short column names are used in result sets. If you have problems that your result sets are returned with keys of the form "tablename.columnname" when you do a join query, then you should upgrade to the current version of PHP.

Firebird (Interbase)

  • This Adapter uses the PHP extension php_interbase.

  • Firebird (Interbase) does not support auto-incrementing keys, so you should specify the name of a sequence to lastInsertId() or lastSequenceId().

  • Currently the Zend_Db::CASE_FOLDING option is not supported by the Firebird (Interbase) adapter. Unquoted identifiers are automatically returned in upper case.

  • Adapter name is ZendX_Db_Adapter_Firebird.

    Remember to use the param adapterNamespace with value ZendX_Db_Adapter.

    We recommend to update the gds32.dll (or linux equivalent) bundled with PHP, to the same version of the server. For Firebird the equivalent gds32.dll is fbclient.dll.

    By default all identifiers (tables names, fields) are returned in upper case.

Zend Framework