This is an old revision of the document!
MySQL
mysqli driver
Specification
Alternatives
This is the preferred driver to connections to MySQL databases. This preferred driver uses the PHP mysqli interface and supports all MySQL table types, with full support for transactions and rollback when the MySQL table type supports it. This driver replaces both mysql and mysqlt drivers.
This driver also supports connections to all databases derived from MySQL, such as MariaDB and Percona
mysql driver
Specification
Driver Name | mysql |
---|---|
Data Provider | mysql) |
Status | Obsolete3) |
Windows | Yes |
Unix | Yes |
ADOdb V5 | Yes |
ADOdb V6 | No |
This driver uses the PHP original mysql driver and only provides support to non-transactional tables such as MyIsam. It cannot be used with the PHP 'Improved' MySQL driver. The PHP driver is deprecated as of PHP Version 5.5 and will be removed in PHP version 7. This driver is deprecated as of ADOdb version 5.20 and will be removed in ADOdb version 6.0.
If you are still using this driver (or the mysqlt driver derived from it) you should be planning on migrating to the mysqli driver. Support for both drivers is built into PHP up to version PHP 5.4. From an ADOdb standpoint, it is simply a case of switching from
$db = newAdoConnection('mysql')
to
$db = newAdoConnection('mysqli')
mysqlt driver
Specification
Driver Name | mysqlt |
---|---|
Data Provider | mysql) |
Status | Obsolete4) |
Windows | Yes |
Unix | Yes |
ADOdb V5 | Yes |
ADOdb V6 | No |
This driver uses the PHP original mysql driver and provided support to transactional tables such as InnoDB. It cannot be used with the PHP 'improved' MySQL driver. The PHP driver is deprecated as of PHP Version 5.5 and will be removed in PHP version 7. This driver is deprecated as of ADOdb version 5.20 and will be removed in ADOdb version 6.0
mysqlpo driver
Specification
Driver Name | mysqlpo |
---|---|
Data Provider | mysql) |
Status | Obsolete5) |
Windows | Yes |
Unix | Yes |
ADOdb V5 | Yes |
ADOdb V6 | No |
This driver duplicates the functionality of the mysqlt driver and is not maintained. It will be removed in ADOdb version 6.0
Driver Specific Issues
renameColumnSql
The method renameColumnSql normally takes 3 parameters, $tableName
,
$oldColumnName
and $newColumnName
. When used with the mysql provider, a full definition of the column must be provided, as if creating the column new
Usage
/* * We are going to rename a column from col9 to col6. */ $flds = 'col6 C(50) NOTNULL DEFAULT "BILL"'; # Then create a data dictionary object, using this connection $dict = NewDataDictionary($db); $sql = $dict->renameColumnSql($table,'col9','col6', $flds);