PHP and PDO driver for CUBRID are both PHP extension written by C programming language, and released at PECL. So you can easily install them using PECL. They both support Linux (32-bit and 64-bit) and Windows platform. But a DLL for this PECL extension is currently unavailable, you can directly download the DLL (and also .so) file at sourceforge.net or cubrid.org. For detailed guidance about both PECL and binary installation, please read Instructions on cubrid.org
If you want to build your own binary from source codes on Linux or Windows, please read the build-guide.html in the CUBRID PHP & PDO release package.
Note: You can run php --ini to find the path of php.ini which the current PHP has loaded.
CUBRID PHP and PDO are both need the CUBRID CCI library. The CCI library is in $CUBRID/lib, and its header file is in $CUBRID/include. If you have set the environment $CUBRID, when installing CUBRID PHP or PDO using PECL, PECL will automatically validate the CCI library and its header file. If not, you must input the installation path of CUBRID manually when PECL is configuring the project.
If you install the CUBRID PHP or PDO on Linux, be sure that path "$CUBRID/lib" is added into environment variable $LD_LIBRARY_PATH. (It contains a colon-separated list of directories that the dynamic linker should search for shared objects when building a process image after exec, before searching in any other directories.)
You can find the docs at www.php.net and docs.php.net. (CUBRID PHP Doc and CUBRID PDO Doc ). And you can find the release notes or change log at PECL (CUBRID PHP PECL and CUBRID PDO PECL), and when CUBRID PHP and PDO for new version CUBRID is released, there will be a release notes in its release package.
CUBRID PHP provides all kinds of functions to help user making full use of CUBRID. In addition, many CUBRID MySQL Compatibility Functions have been added, which makes PHP application written for MySQL migrate to CUBRID easily.
CUBRID PDO implements almost all functions in PDO, except the function getColumnMeta. This function is EXPERIMENTAL. The behavior of this function, its name, and surrounding documentation may change without notice in a future release of PHP. So CUBRID PDO doesn’t implement this function. Instead, CUBRID PDO provides a new function cubrid_schema which plays the same role in CUBRID PHP.
Both CUBRID PHP and PDO support transaction. CUBRID PDO supports auto-commit, but CUBRID PHP version lower than 8.4.0 doesn't support auto-commit.
In CUBRID PDO (and CUBRID PHP 8.4.0 or higher), autocommit_mode is enable by default. You can use PDO::setAttribute() (cubrid_set_db_parameter in CUBRID PHP) to change its state. If you use PDO::beginTransaction (not need in CUBRID PHP) to begin a transaction, it will disable autocommit_mode and restore it after PDO::commit (cubrid_commit in CUBRID PHP) or PDO::rollBack (cubrid_rollback in CUBRID PHP). Note that before disabling the autocommit_mode, any pending transaction is automatically committed.
Transaction isolation level is the degree to which a transaction is separated from all other concurrent transactions. The higher isolation level means the lower interference from other transactions. The lower isolation level means the higher the concurrency. CUBRID supports isolation level from 1 to 6, and its default value is 3.
In CUBRID PHP 8.3.0 or higher, you can get the connection isolation level value using cubrid_get_db_parameter. And in CUBRID PHP 8.4.0 or higher, you can set its value using cubrid_set_db_parameter.
In CUBRID PDO 8.3.0 and 8.3.1, you can get the isolation level value using PDO::getAttribute(PDO::ATTR_SERVER_INFO). And in CUBRID PDO 8.4.0, you can get its value using using PDO::getAttribute(PDO::CUBRID_ATTR_ISOLATION_LEVEL), and set its value using using PDO::setAttribute. For example, PDO::setAttribute(PDO::CUBRID_ATTR_ISOLATION_LEVEL, PDO::TRAN_COMMIT_CLASS_UNCOMMIT_INSTANCE).
CUBRID supports prepared statement. You can use it in both CUBRID PHP and CUBRID PDO. But you don't need to prepare every SQL statement. Prepared statements offer two major benefits: The query only needs to be parsed (or prepared) once, but can be executed multiple times with the same or different parameters; The parameters to prepared statements don't need to be quoted, and the driver automatically handles this. So for example, if you want to execute a complicated sql statement multi-times, you'd better prepare it first.
But if there are parameters in sql statement. You should prepare the statement before you bind value to the parameter. In CUBRID PDO, it supports both positional parameter and named parameter. In CUBRID PHP, it supports positional parameter, and in CUBRID PHP 8.4.0 or higher, it also supports named parameter.
CUBRID supports both forward only and scrollable cursor. In CUBRID PHP, it only supports scrollable cursor. In CUBRID PDO, the default cursor type is forward only cursor, and you can change the cursor type using PDO::prepare. For example, PDO::prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL)).
You can use cubrid_schema in CUBRID PHP and PDO::cubrid_schema in CUBRID PDO to get database schema information. There defines all kinds of schema type, including primary key, foreign keys, column attribute and so on.
In CUBRID PHP, you can check if there is error or not using the return value of function. In CUBRID PDO, it offers a choice of 3 different error handling strategies: PDO::ERRMODE_SILENT, PDO::ERRMODE_WARNING and PDO::ERRMODE_EXCEPTION. PDO::ERRMODE_SILENT is the default mode.
In CUBRID PHP, you can get error information (including error facility code, error code and error message) using cubrid_error_code_facility, cubrid_error_code, and cubrid_error_msg. In CUBRID PDO, you can get error information about connection using PDO::errorCode and PDO::errorInfo, and get error information about statement using PDOStatement->errorCode and PDOStatement->errorInfo.
CUBRID supports both BLOB and CLOB data type. In CUBRID PHP, you can insert LOB into CUBRID like any other ordinary data type, except that you should bind a PHP stream when you work with LOB. And you can get and read LOB using some specific functions in CUBRID PHP.