ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


Action unknown: siteexport_addpage
v5:database:mysql

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 driver uses the PHP mysqli interface and supports all table types, with full support for transactions and rollback when the table type supports it.

It replaces Legacy MySQL drivers (mysql, mysqlt and mysqlpo).


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

Connecting With SSL

From ADOdb version 5.21, you can make an SSL connection to MySQL in the following way:

/*
* Enable ADOdb
*/
$db = newAdoConnection('mysqli')
/*
* Set the SSL parameters
*/
$db->ssl_key    = "key.pem";
$db->ssl_cert   = "cert.pem"; 
$db->ssl_ca     = "cacert.pem";
$db->ssl_capath = null; 
$db->ssl_cipher = null; 
 
/*
* Open the connection
*/
$db->connect($host, $user, $password, $database);
1)
This driver is actively supported by ADOdb project members
v5/database/mysql.txt · Last modified: 2020/01/15 03:38 by mnewnham