- skip to content

# Database Abstraction Layer

### User Tools

- Login

### Site Tools

- Recent changes
- Media Manager
- Sitemap

### Sidebar

##### Resources

- Reference Manual
- User Guide
- The Data Dictionary
- ADOdb-xmlschema
- ADOdb Active Record
- Performance Monitoring
- Date/Time Library
- Session Management Library
- Unsupported Addons
- Coding Standards

##### Supported Databases

- Access
- ADO
- CSV
- Firebird
- Frontbase
- IBM DB2
- Informix
- Interbase
- LDAP
- Microsoft SQL Server
- MySQL
- Netezza
- ODBC
- ODBTP
- Oracle
- PDO
- Postgresql
- SAP ADS
- SAP ASE
- SAP Maxdb
- SAP Sqlanywhere
- Sqlite
- Sybase
- Plain Text
- Visual Foxpro

##### Other

- Feature Comparison Matrix
- Connection Matrix
- Include File Guide

v5:database:mysql

# MySQL

## mysqli driver

##### Specification

Driver Name | mysqli
Data Provider | mysql1)
Status | Active2)
Windows | Yes
Unix | Yes
ADOdb V5 | Yes
ADOdb V6 | Yes

##### Alternatives

PDO driver for MySQL

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);

[MySQL, windows, unix, supported]
1) ADOdb version 5, in ADOdb version 6 this driver will become a data provider
2) This driver is actively supported by ADOdb project members
3) , 4) , 5) This driver will be removed in ADOdb version 6
v5/database/mysql.txt · Last modified: 2016/01/12 17:06 by mnewnham

### Page Tools

- Show pagesource
- Old revisions
- Backlinks
- Rename Page
- Back to top