ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:database:mysql

This is an old revision of the document!


MySQL

mysqli driver

Specification
Driver Namemysqli
Data Providermysql
StatusActive1)
WindowsYes
UnixYes
ADOdb V5Yes
ADOdb V6Yes
Alternatives

PDO driver for MySQL

This is the preferred driver for connections to the following databases:

This preferred driver uses the PHP mysqli interface and supports all table types, with full support for transactions and rollback when the table type supports it.

This driver replaces both mysql and mysqlt drivers.

mysql driver

Specification
Driver Namemysql
Data Providermysql)
StatusObsolete2)
WindowsYes
UnixYes
ADOdb V5Yes
ADOdb V6No

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 Namemysqlt
Data Providermysql)
StatusObsolete3)
WindowsYes
UnixYes
ADOdb V5Yes
ADOdb V6No

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 Namemysqlpo
Data Providermysql)
StatusObsolete4)
WindowsYes
UnixYes
ADOdb V5Yes
ADOdb V6No

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);
1)
This driver is actively supported by ADOdb project members
2) , 3) , 4)
This driver will be removed in ADOdb version 6
v5/database/mysql.1458431426.txt.gz · Last modified: 2017/04/21 11:24 (external edit)