v5:database:mysql
This is an old revision of the document!
MySQL
mysqli driver
Specification
Alternatives
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.1579055931.txt.gz · Last modified: 2020/01/15 03:38 by mnewnham